Re: check path.exists() with a "converted" path

2010-09-27 Thread Alessandro
people, you're great - best newsgroup I've ever been! I think I'll go with the glob suggestion - works like a charm!!! thank you... alessandro -- http://mail.python.org/mailman/listinfo/python-list

Re: check path.exists() with a "converted" path

2010-09-27 Thread Peter Otten
Alessandro wrote: > Hi, I'm a python newbie with a problem too hard to tackle. > > I have a string defining a path, were all the spaces have been > converted to underscores. > How can I find if it corresponds to a real path? > > e.g. a string like '/some/path_to/directory_1/and_to/directory_2' >

Re: check path.exists() with a "converted" path

2010-09-27 Thread Raphaël Plasson
On Sep 27, 6:23 pm, Alessandro wrote: > > I have a string defining a path, were all the spaces have been > converted to underscores. > (...) > > notice that the real path can contain BOTH spaces and underscores. > > How can I feed it to os.path.exists() ??? You are losing some information, ther

Re: check path.exists() with a "converted" path

2010-09-27 Thread Paul Rudin
Alessandro writes: > Hi, I'm a python newbie with a problem too hard to tackle. > > I have a string defining a path, were all the spaces have been > converted to underscores. > How can I find if it corresponds to a real path? > > e.g. a string like '/some/path_to/directory_1/and_to/directory_2' >

Re: check path.exists() with a "converted" path

2010-09-27 Thread Chris Rebert
On Mon, Sep 27, 2010 at 2:23 AM, Alessandro wrote: > Hi, I'm a python newbie with a problem too hard to tackle. > > I have a string defining a path, were all the spaces have been > converted to underscores. > How can I find if it corresponds to a real path? > > e.g. a string like '/some/path_to/di

check path.exists() with a "converted" path

2010-09-27 Thread Alessandro
Hi, I'm a python newbie with a problem too hard to tackle. I have a string defining a path, were all the spaces have been converted to underscores. How can I find if it corresponds to a real path? e.g. a string like '/some/path_to/directory_1/and_to/directory_2' with a real path: '/some/path_to/d