files,folders,paths

Ben Finney ben+python at benfinney.id.au
Sun Feb 13 18:15:06 EST 2011


Tim Roberts <timr at probo.com> writes:

> ecu_jon <hayesjdno3 at yahoo.com> wrote:
> >
> >i know backslashes are special. there a special pain in my #$%.
> >without a windows environment, you would have to change destination2
> >significantly to try it out. but like i said above you can try
> >version 11 in a linux environment.
>
> If they are a pain in your #$%, then don't use them. You can use
> forward slashes everywhere in Windows, except when typing commands at
> the command prompt. ALL of the Windows file system APIs accept forward
> slashes.

Even better: Don't manually handle the path component separator at all,
and use ‘os.path.join’ to do it correctly. That's exactly what it's
there for.

-- 
 \      “We tend to scoff at the beliefs of the ancients. But we can't |
  `\        scoff at them personally, to their faces, and this is what |
_o__)                                         annoys me.” —Jack Handey |
Ben Finney



More information about the Python-list mailing list