Sharkadder
Programmer
Hi, since this is a tcl forum i persume you python guys may know about or have used tcl in the past.
I have a question about python and outputting values to another program, i have achieved it but not the way in which i'd like.
Basically i want to send information to a tcl file in which i have created. However the way i've seen so far is to send the data down a pipe using open2 within python. This is great, however does anybody know how i could use 2 pipes or indeed use another form of communication between python and tcl?
With me programming mainly in C# of late i am thinking ways which are not possible in python, however i'm sure one of you guys can point me in the right direction.
Here is code i currently use to send data to tcl from python.
fout, fin = os.popen2("wish ./myfile.tcl", "t")
myvar = "hello"
myvar2 = "world"
fout.write(myvar)
fout.write('\n')
fout.write(myvar2)
fout.write('\n')
fout.close()
So basically i'm wanting to send 2 variables from python to tcl as shown above, then have them stored in their own variable within tcl. It is storing them in seperate variables within tcl i am unsure about.
I am doing this for some good programming practise, so i'd rather not resort to using the tcl/tk interface within python and do it this way instead.
Many thanks
I have a question about python and outputting values to another program, i have achieved it but not the way in which i'd like.
Basically i want to send information to a tcl file in which i have created. However the way i've seen so far is to send the data down a pipe using open2 within python. This is great, however does anybody know how i could use 2 pipes or indeed use another form of communication between python and tcl?
With me programming mainly in C# of late i am thinking ways which are not possible in python, however i'm sure one of you guys can point me in the right direction.
Here is code i currently use to send data to tcl from python.
fout, fin = os.popen2("wish ./myfile.tcl", "t")
myvar = "hello"
myvar2 = "world"
fout.write(myvar)
fout.write('\n')
fout.write(myvar2)
fout.write('\n')
fout.close()
So basically i'm wanting to send 2 variables from python to tcl as shown above, then have them stored in their own variable within tcl. It is storing them in seperate variables within tcl i am unsure about.
I am doing this for some good programming practise, so i'd rather not resort to using the tcl/tk interface within python and do it this way instead.
Many thanks