On 7/19/2011 2:15 AM, Thomas 'PointedEars' Lahn wrote:
Steven D'Aprano wrote:
Nulpum wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
Yes.
print "logs/2011-07-03"
logs/2011-07-03
print "logs\2011-07-03"
l
On 2011-07-19, Nulpum wrote:
> I want to make sure that folder exists.
>
> '2011-07-03' is really exists. but 'os.path.isdir' say false
>
> Does anyone know why?
>
>
>
os.path.isdir("C:\Users\??\Desktop\logs")
> True
os.path.isdir("C:\Users\??\Desktop\logs\2011-07-03")
> False
Y
Steven D'Aprano wrote:
Thomas Jollans wrote:
The "correct" solution in many cases is to not assume any particular
path separator at all, and use os.path.join when dealing with paths.
This will work even on systems that do not accept forward slashes as
path separators. (does Python still support
On 7월19일, 오후3시15분, Thomas 'PointedEars' Lahn
wrote:
> Steven D'Aprano wrote:
> > Nulpum wrote:
> >> I want to make sure that folder exists.
>
> >> '2011-07-03' is really exists. but 'os.path.isdir' say false
>
> >> Does anyone know why?
>
> > Yes.
>
> print "logs/2011-07-03"
> > logs/2011-07-
Thomas Jollans wrote:
> On 19/07/11 06:42, Steven D'Aprano wrote:
>> (1) Escape every backslash with an extra backslash:
>>
> print "logs\\2011-07-03"
>> logs\2011-07-03
>
> There is a more elegant solution: use raw strings: r'c:\foo\bar'
Well, perhaps, but not all paths can be written as
On Jul 19, 1:42 pm, Steven D'Aprano wrote:
> Nulpum wrote:
> > I want to make sure that folder exists.
>
> > '2011-07-03' is really exists. but 'os.path.isdir' say false
>
> > Does anyone know why?
>
> Yes.
>
> >>> print "logs/2011-07-03"
> logs/2011-07-03
> >>> print "logs\2011-07-03"
>
> logs 1-
On 19/07/11 06:42, Steven D'Aprano wrote:
> Nulpum wrote:
>
>> I want to make sure that folder exists.
>>
>> '2011-07-03' is really exists. but 'os.path.isdir' say false
>>
>> Does anyone know why?
>
> Yes.
>
print "logs/2011-07-03"
> logs/2011-07-03
print "logs\2011-07-03"
> logs�1-07
Steven D'Aprano wrote:
> Nulpum wrote:
>> I want to make sure that folder exists.
>>
>> '2011-07-03' is really exists. but 'os.path.isdir' say false
>>
>> Does anyone know why?
>
> Yes.
>
print "logs/2011-07-03"
> logs/2011-07-03
print "logs\2011-07-03"
> logs�1-07-03
>
> Don't use
Nulpum wrote in news:0bf400a3-735c-487a-8d74-
feb3b56be...@g5g2000prn.googlegroups.com in gmane.comp.python.general:
> I want to make sure that folder exists.
> '2011-07-03' is really exists. but 'os.path.isdir' say false
> Does anyone know why?
>
os.path.isdir("C:\Users\Á¶Ã¢ÁØ\Desktop\logs"
Nulpum wrote:
> I want to make sure that folder exists.
>
> '2011-07-03' is really exists. but 'os.path.isdir' say false
>
> Does anyone know why?
Yes.
>>> print "logs/2011-07-03"
logs/2011-07-03
>>> print "logs\2011-07-03"
logs�1-07-03
Don't use backslashes as path separators in Python. Back
What is the output of:
>>> os.path.exists("C:\Users\조창준\Desktop\logs\2011-07-03")
? One possible issue here is that for some reason os.path.isdir()
can't even access the directory either because of permissions,
misinterpretation of the path, or some other reason.
Michael
2011/7/19 Nulpum :
> I
2011/7/19 Nulpum :
> I want to make sure that folder exists.
>
> '2011-07-03' is really exists. but 'os.path.isdir' say false
>
> Does anyone know why?
>
>
>
os.path.isdir("C:\Users\조창준\Desktop\logs")
> True
os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03")
> False
Works here. Are you
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
>>> os.path.isdir("C:\Users\조창준\Desktop\logs")
True
>>> os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03")
False
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo