[Tutor] Python popen command using cat > textfile .... how to terminate

MK lopoff at gmx.net
Thu May 14 23:50:26 CEST 2009


Hi there,

i am using this code to send an "cat > ThisIsMyUrl" with popen.
Of cos cat now waits for the CTRL+D command. 
How can i send this command ?

def console_command(cmd):
	print cmd
	console = os.popen(cmd,"r")
	output = console.read()
	console.close()
	return output

command="cat > " + working_dir + "/" + subdir + "www.thisismyurl.com"
console_command(command)


Thank you.




More information about the Tutor mailing list