Newbie Questions

Cameron Laird claird at starbase.neosoft.com
Thu Jan 17 11:24:13 EST 2002


In article <mailman.1011212508.21110.python-list at python.org>,
maximilianscherr <MaximilianScherr at T-Online.de> wrote:
			.
			.
			.
>I want my script to ask some questions, write the answers to some 
>config files for an external program, start this immediately by 
>sending an ENTER input to the application.
>And after this the program should wait for a (socket?)request from a 
>server, and then exit.
			.
			.
			.
I'm lost.  While I'm reasonably certain what you want
is feasible, I don't know what it is you want.

Servers don't make requests.  *Clients* do.  I'll put
aside the entire "And after this ..." paragraph for now.

You have a Tkinter application.  You want users to fid-
dle with it for a while, then something happens (maybe
a "Push me to make things happen now" button), and
configuration information is written to an external
file.  I think you're saying you can do that already.
Immediately after, your Tkinter application should
launch a specific external program.  Python has several
mechanisms to effect this.  When you write, "... by
sending an ENTER input to the application", I think
you're saying that the external program expects a bit
of interaction on its stdin.  If that's all you're
after, you're in luck; it's easy to use os.popen:
  import os
  file_handle = os.popen('external_program', 'w')
  file_handle.write('\n')
  file_handle.close()  
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list