Re: Raw Strings (I Think)

2008-07-28 Thread Gabriel Genellina
En Thu, 24 Jul 2008 12:02:00 -0300, Lanny <[EMAIL PROTECTED]> escribió: > I've used glob.glob to get a list of files in a directory > and now I want to use os.system to execute one of > those files, the problem is that python automatically > puts a escape charater infront of the back slashes > so

Re: Raw Strings (I Think)

2008-07-23 Thread Lanny
> my guess is that the real problem is that you get back filenames with > spaces in them, which gets treated as multiple arguments by os.system. > > using os.startfile will fix this: > > >>> import glob, os, random > >>> file = random.choice(glob.glob("\\music\\*.mp3")) > >>> file > '\\music\\Madr

Re: Raw Strings (I Think)

2008-07-23 Thread Carsten Haese
Lanny wrote: No, it doesn't. Instead of guessing what the cause might be, please show us your code and show us the error message you're getting, so that we can determine what the cause really is. Ok, sorry. Heres my code: > [...] And the error message you're getting is...? -- Carsten Haese

Re: Raw Strings (I Think)

2008-07-23 Thread Fredrik Lundh
Lanny wrote: No, it doesn't. Instead of guessing what the cause might be, please show us your code and show us the error message you're getting, so that we can determine what the cause really is. Ok, sorry. Heres my code: import glob import random import os songs = glob.glob('C:\###\###\###

Re: Raw Strings (I Think)

2008-07-23 Thread Lanny
> No, it doesn't. Instead of guessing what the cause might be, please show > us your code and show us the error message you're getting, so that we can > determine what the cause really is. Ok, sorry. Heres my code: import glob import random import os songs = glob.glob('C:\###\###\###\*.mp3') p

Re: Raw Strings (I Think)

2008-07-23 Thread Fredrik Lundh
Lanny wrote: I've used glob.glob to get a list of files in a directory and now I want to use os.system to execute one of those files, the problem is that python automatically puts a escape charater infront of the back slashes so the os.system gets X:\\\\\\ and is useless, No, it doesn'

Re: Raw Strings (I Think)

2008-07-23 Thread Carsten Haese
Lanny wrote: I've used glob.glob to get a list of files in a directory and now I want to use os.system to execute one of those files, the problem is that python automatically puts a escape charater infront of the back slashes No, it doesn't. Instead of guessing what the cause might be, please s

Re: Raw Strings (I Think)

2008-07-23 Thread Mike Driscoll
On Jul 24, 10:02 am, "Lanny" <[EMAIL PROTECTED]> wrote: > I've used glob.glob to get a list of files in a directory > and now I want to use os.system to execute one of > those files, the problem is that python automatically > puts a escape charater infront of the back slashes > so the os.system get

Raw Strings (I Think)

2008-07-23 Thread Lanny
I've used glob.glob to get a list of files in a directory and now I want to use os.system to execute one of those files, the problem is that python automatically puts a escape charater infront of the back slashes so the os.system gets X:\\\\\\ and is useless, I think I need to convert my st