hi

why not use os.path.normpath ?? ( http://docs.python.org/library/os.path.html#os.path.normpath )

or even:

os.path.normpath(os.path.join(root, path_part1, path_part2, ...))

Maybe I did not understand the initial problem.

~DR0ID

On 12.09.2010 03:38, mdg583 wrote:
Huh, I guess this is why this went unnoticed: on my system I get the
following:

print "/".join(os.path.split(r"foobaz"))
/foobaz
print "/".join(os.path.split(r"foobar/foobaz"))
foobar/foobaz
print "/".join(os.path.split(r"C:\foobar\foobaz"))
/C:\foobar\foobaz

So split doesn't split the path into many pieces, just 2: the path
before the file, and the filename.

dirpath.replace("\\", "/") ?
or maybe:
dirpath = dirpath.replace(os.sep, "/")

I think that means right now forward slashes are not being forced.


--
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to