> In my case, I was building up a command line to pass as a single string > to subprocess, and needed a way to quote the args explicitly. That's > why I went looking at this. FYI, if you need the reverse operation (string → list), look at shlex. Cheers