EvilZone

Programming and Scripting => Scripting Languages => : Ragehottie February 12, 2012, 06:36:34 PM

: [Python] Control CMD with python?
: Ragehottie February 12, 2012, 06:36:34 PM
I'm making a telnet-type of program. I can send and receive text fine, but I can not find how to have python export commands to CMD. I am making a kinda trojan thing to fuck with my friends. Any help would be awesome.
: Re: [Python] Control CMD with python?
: ande February 12, 2012, 06:54:34 PM
If you are going to use CMD for telnet I suggest you look into networking with python instead. But the system call will do what you want:

:
import os
cmd = 'ping google.com'
os.system(cmd)
: Re: [Python] Control CMD with python?
: Ragehottie February 13, 2012, 01:04:07 AM
Thank ya very kindly sir.
: Re: [Python] Control CMD with python?
: xeross February 14, 2012, 12:22:32 PM
I think it'd be a better idea to use the new subprocess (http://docs.python.org/library/subprocess.html#module-subprocess) module, that way you can control input/output streams
: Re: [Python] Control CMD with python?
: Stackprotector February 16, 2012, 05:37:33 PM
In the tutorial section there is a guide on networking with python, take a look!.