Subprocess.Popen - passing args help

Fredrik Lundh fredrik at pythonware.com
Wed Nov 2 18:53:23 CET 2005


"Ernesto" wrote:

> A nice person from another thread helped me...
>
> a = 'disable "@USB\VID_0403&PID_6010&MI_00\7&15E4F68&1&0000'
> print a
> disable "@USB\VID_0403&PID_6010&MI_00&15E4F68&1&0000
>
> \7 is the ASCII bell so your args may be different from what you think.
>
>
> I thought the quote method I have fixes this problem, but I guess I was
> wrong.  Anyone have suggestions on how I can get that parameter in
> there without the '\7' part getting lost?

try

    a = r'disable "@USB\VID_0403&PID_6010&MI_00\7&15E4F68&1&0000'

or

    a = 'disable "@USB\\VID_0403&PID_6010&MI_00\\7&15E4F68&1&0000'

also see section 3.1.2 in the Python Tutorial, and this page:

    http://docs.python.org/ref/strings.html

</F>






More information about the Python-list mailing list