Re: Python doesn't see the directories I create

2007-08-31 Thread Neil Cerutti
On 2007-08-31, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Neil > Cerutti wrote: >> Keeping in mind which came first, isn't it at least as >> accurate to attribute this problem to Python's choice of >> escape character? > > No, it's Microsoft's fault. The use of

Re: Python doesn't see the directories I create

2007-08-30 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Neil Cerutti wrote: > Keeping in mind which came first, isn't it at least as accurate > to attribute this problem to Python's choice of escape character? No, it's Microsoft's fault. The use of backslash as an escape character goes back to Unix systems in the early

Re: Python doesn't see the directories I create

2007-08-30 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch wrote: > Even on Unix it shouldn't be a problem on most file systems to create a > directory named 'C:' Except that some commands (e.g. scp, rsync) will interpret the colon as delimiting a host name. Also remember that, unless you write it

Re: Python doesn't see the directories I create

2007-08-30 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : > On Thu, 30 Aug 2007 07:28:52 -0400, Steve Holden wrote: > > >>Bruno Desthuilliers wrote: >> >>>Steve Holden a écrit : >>>Indeed. But I doubt a path starting with 'C:' will work fine on a >>>unix-like environment anyway !-) >> >>Just to be contrarian: >> >>[EM

Re: Python doesn't see the directories I create

2007-08-30 Thread Neil Cerutti
On 2007-08-30, Steve Holden <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> To me, Python's collection of special-purpose string literal >> notations is one of its little warts. > > Well, it's a wart that's shared with many other languages - > including, interestingly enough, Microsoft's very o

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Steve Holden wrote: [...] > The fact is that some strings are always going to cause trouble. > Unfortunately programming itself is a task that requires a little more > knowledge to be applied to the task. Just learn the rules and move on. As a quick follow-up, I had intended to comment on the us

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Neil Cerutti wrote: > On 2007-08-30, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> mr_gadget a écrit : >>> When I create a subfolder, python is not seeing it. Can someone please >>> explain this behaviour ? I just started with python, read the tutorial over >>> the weekend and am writing my v

Re: Python doesn't see the directories I create

2007-08-30 Thread Neil Cerutti
On 2007-08-30, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > mr_gadget a écrit : >> When I create a subfolder, python is not seeing it. Can someone please >> explain this behaviour ? I just started with python, read the tutorial over >> the weekend and am writing my very first script. So I may

Re: Python doesn't see the directories I create

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 07:28:52 -0400, Steve Holden wrote: > Bruno Desthuilliers wrote: >> Steve Holden a écrit : >> Indeed. But I doubt a path starting with 'C:' will work fine on a >> unix-like environment anyway !-) > > Just to be contrarian: > > [EMAIL PROTECTED] ~/Projects/python.org/build >

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Bruno Desthuilliers wrote: > Steve Holden a écrit : >> Bruno Desthuilliers wrote: [...] >> That does indeed work in most situations, but ideally (i.e. for maximum >> code portability) paths should be constructed using os.path.join(), or >> collected from the environment somehow. > > Indeed. But

Re: Python doesn't see the directories I create

2007-08-30 Thread Bruno Desthuilliers
Steve Holden a écrit : > Bruno Desthuilliers wrote: (snip) >> You can avoid all escaping by using raw strings: >> >> mypath = r"C:\enhancement\rawfiles\" >> > Please note that the above is a well-known syntax error. A string > literal cannot end with a single backslash, as it escapes the closing

Re: Python doesn't see the directories I create

2007-08-30 Thread Steve Holden
Bruno Desthuilliers wrote: > mr_gadget a écrit : >> When I create a subfolder, python is not seeing it. Can someone please >> explain this behaviour ? I just started with python, read the tutorial over >> the weekend and am writing my very first script. So I may not be seeing >> something. Both

Re: Python doesn't see the directories I create

2007-08-30 Thread lupino
Ciao mr_gadget, > When I create a subfolder, python is not seeing it. Can someone please > explain this behaviour ? I just started with python, read the tutorial over > the weekend and am writing my very first script. So I may not be seeing > something. Both os.path and glob.glob seem not to se

Re: Python doesn't see the directories I create

2007-08-30 Thread Marc 'BlackJack' Rintsch
On Thu, 30 Aug 2007 04:30:50 -0400, mr_gadget wrote: > C:\>python -c "import os; print os.path.exists('C:\enhancement\rawfiles')" > > False > > C:\>python -c "import os; print os.path.exists('C:\\enhancement\\rawfiles')" > > True The backward slash has a special meaning in string literals. It

Re: Python doesn't see the directories I create

2007-08-30 Thread Diez B. Roggisch
mr_gadget schrieb: > When I create a subfolder, python is not seeing it. Can someone please > explain this behaviour ? I just started with python, read the tutorial over > the weekend and am writing my very first script. So I may not be seeing > something. Both os.path and glob.glob seem not to

Re: Python doesn't see the directories I create

2007-08-30 Thread Bruno Desthuilliers
mr_gadget a écrit : > When I create a subfolder, python is not seeing it. Can someone please > explain this behaviour ? I just started with python, read the tutorial over > the weekend and am writing my very first script. So I may not be seeing > something. Both os.path and glob.glob seem not to

Python doesn't see the directories I create

2007-08-30 Thread mr_gadget
When I create a subfolder, python is not seeing it. Can someone please explain this behaviour ? I just started with python, read the tutorial over the weekend and am writing my very first script. So I may not be seeing something. Both os.path and glob.glob seem not to see a folder I created. Ot