Escape spaces in strings

A

Andrew Dalke

Florian said:
is there a function to escape spaces and other characters in string for
using them as a argument to unix command? In this case rsync
(http://samba.anu.edu.au/rsync/FAQ.html#10)

It's best that you use the subprocess module and completely skip
dealing with shell escapes. The module is standard with 2.4 but
you can get the module and use it for 2.2 or 2.3.

http://docs.python.org/lib/module-subprocess.html

http://cvs.sourceforge.net/viewcvs.py/*checkout*/python/python/dist/src/Lib/subprocess.py

Andrew
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top