windows / unix path

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sat Oct 18 18:51:01 EDT 2008


In message
<5bc219f8-07cd-4aaf-ad6f-8850fef62d60 at m73g2000hsh.googlegroups.com>,
Marcin201 wrote:

> os.path.join('Pictures', '01.jpg') returns 'Pictures\\01..jpg' on
> Win.  When I read files created on Win under Unix this is a problem,
> python cannot open 'Pictures\\01.jpg'

But it can on Windows, right?

os.path contains functions specific to the _current_ platform (the one your
script is running on). If you're trying to perform pathname manipulations
on behalf of another platform, you shouldn't be using os.path.



More information about the Python-list mailing list