[Tutor] popen
Andrew Wilkins
toodles@yifan.net
Sun, 29 Apr 2001 13:28:16 +0800
Hi tutors!
I want my program to do the following:
In main.py, in an infinity loop (temporarily) it continually runs an update
command. I want to open up a new python window for input, for an
administrator to punch in commands using input() or raw_input().
input.py looks like this:
while 1:
x=input('>')
print x #print to the main process
Now I tried using os.popen:
input_process=os.popen('python input.py')
This works, but the window doesn't show up! It's probably not meant to, but
is there a way around this? Because otherwise I can not input at all...
Is there another function that does this better?
TIA, Andrew