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

Re: Python question

2014-04-10 Thread Barry Margolin
In article mailman.19336.1397098937.10748.gnu-misc-disc...@gnu.org, Richard Stallman r...@gnu.org 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

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

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