Re: Python question

2014-04-10 Thread Brandon Invergo
> How, in Python, can I execute a string as a shell command? You should use the 'call' function of the 'subprocess' module. You can either pass it a string with the full command or a list of strings comprising the command (like execv in libc). You must pass the 'shell=True' option if you are pas

Re: Python question

2014-04-10 Thread Barry Margolin
In article , Richard Stallman wrote: > [[[ To any NSA and FBI agents reading my email: please consider]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > How, in Python, can I execute a str

Re: Python question

2014-04-10 Thread Florian Weimer
* Richard Stallman: > How, in Python, can I execute a string as a shell command? This is often an extremely bad idea because it results in shell command injection vulnerabilities. Instead of os.system(), use the subprocess module, which keeps the argument list separate and does not involve the s

Re: Python question

2014-04-10 Thread Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Thanks. -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St B