import commands
On Thu, May 14, 2009 at 4:28 PM, vince spicer <[email protected]> wrote:
> Take a peak at commands.getoutput
>
>
> EX:
>
> import commmands
>
> ls = commands.getoutput("ls- ls")
>
> Vince
>
>
> On Thu, May 14, 2009 at 3:50 PM, MK <[email protected]> wrote:
>
>> 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.
>>
>>
>> _______________________________________________
>> Tutor maillist - [email protected]
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor