raw_input() simulation
Martynas Jocius
mjoc at delfi.lt
Tue Feb 4 00:36:25 EST 2003
Hello,
Here is the backend:
# backend.py
str = raw_input("") # or some analog
print str
And here is the frontend:
# frontend.py
import popen2
fout, fin = popen2.popen2("python backend.py")
Now I want to send to my backend some text and read the output from it.
fout.read() works for output, but, for example, fin.write("test\n") doesn't
work, maybe beacuse it left to "press" <Enter> in a raw input. Is there any
way to simulate input from a keyboard? Couldn't find any example on the net.
Thanks.
Martynas Jocius
--
The best way of learning is learning by doing
http://mjoc.sig.lt
More information about the Python-list
mailing list