How to escape os.system() calls?

shlex.quote() does what you want since python 3.

(Use pipes.quote to support both python 2 and python 3)

Leave a Comment