用tcl运行python脚本 [英] running a python script with tcl
本文介绍了用tcl运行python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图通过tcl ware命令运行脚本,但无法运行它。我曾经用eclipse来编写脚本,并且能够通过eclipse运行它。
解决方案
我正在尝试通过tcl ware命令运行脚本,无法运行它。我曾经用eclipse来编写脚本,并且能够通过eclipse运行它。
帮助我们发布一些相关代码来帮助您。回复此内容时,页面右侧会显示使用[CODE]标签的说明。谢谢。
实际上我找出了问题所在。当我编写的代码是使用python 2.0的机器时,我正在运行python 2.5。你可以帮我在python 2.0中使用这段代码吗?
展开 | 选择 | Wrap | 行号
此代码采用文本文件,其中的数字由列分隔,并且将列标记为零。这就是文本文件的样子:
#Bumber of Bits
12
#Data
0 0 0 0 0 0 0 0 0 0 0 0
12 5 3 4 6 4 5 4 7 5 5 10
24 9 7 7 13 7 9 9 14 10 10 20
这就是它的作用:
#Bumber of Bits
12 br />
#Data
0 0 0 0 0 0 0 0 0 0 0
12 0 3 4 6 4 5 4 7 5 5 10
24 0 7 7 13 7 9 9 14 10 10 20
I am trying to run a script though a tcl ware command and cannot get it to run. I used to eclipse to write the script and was able to run it through eclipse.
解决方案I am trying to run a script though a tcl ware command and cannot get it to run. I used to eclipse to write the script and was able to run it through eclipse.Help us help you by posting some of the relevant code. Instructions for using [ CODE ] tags are on the right hand side of the page when you reply to this. Thanks.
actually I figured out the problem. I am running python 2.5 when the code that I am writing is for a machine that uses python 2.0. Can you help me do the same with this code in python 2.0?
Expand|Select|Wrap|Line Numbers
this code takes a text file with numbers that are separated by columns and zeroes out a colum. this is what the text file looks like:
#Number of Bits
12
#Data
0 0 0 0 0 0 0 0 0 0 0 0
12 5 3 4 6 4 5 4 7 5 5 10
24 9 7 7 13 7 9 9 14 10 10 20
and this is what it does:
#Number of Bits
12
#Data
0 0 0 0 0 0 0 0 0 0 0 0
12 0 3 4 6 4 5 4 7 5 5 10
24 0 7 7 13 7 9 9 14 10 10 20
in the python code the ''elem='' statement is what chooses the column
这篇关于用tcl运行python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取
|
15天全站免登陆