Exec`ing external programs

adrian at twistedliving.com adrian at twistedliving.com
Sun Nov 24 01:28:46 EST 2002


I`m doing something like

import os,sys

a = open('host_list', 'r')
for host in a.readlines():
	os.system('xterm -e atl.py %h &',%(host))

What I`m trying to do is read a list of hostnames and for each one
open an xterm and exec atl.py with host as an argument. I am unable
to background the job, so It hangs until I close the first window.
However if I set a to a list of hostnames inside the script, it 
functions correctly, but fails when reading from a file. I tried
copy.deepcopy after reading from the file with the same results.
Any ideas ?

Adrian




More information about the Python-list mailing list