ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-Tutor
python-Tutor
[Tutor] popen
by Andrew Wilkins other posts by this author
Apr 29 2001 1:27PM messages near this date
Re: [Tutor] Multiplication of polynomials | [Tutor] Help with the technique "Menu Processing"
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



_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved