> 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
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
* 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
[[[ 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