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 backslash as
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.
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
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 see
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 is used
to
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 see a
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 os.path
Steve Holden a écrit :
Bruno Desthuilliers wrote:
(snip)
You can avoid all escaping by using raw strings:
mypath = rC:\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
quote.
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 I doubt a
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
$ ls
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 not be
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 very first
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
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 own C#,
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:
[EMAIL PROTECTED]
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
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
17 matches
Mail list logo