By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 1,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

path.py and directory naming: trailing slash automatic?

P: n/a
Hi,

I'm a big fan of path.py. One thing that I think is a good idea is for
directories to automatically have a slash appended to them if it is not
automatically added. Eg:

from path import path

dir = path('/some/dir')

x = dir + "file" # should yield /some/dir/file
I emailed the author of path.py but I think he must be extremely busy.
It took him 2-3 weeks to answer my first email and it's been longer
than that for the one I sent regarding this.

Nov 10 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"me***********@gmail.com" <me***********@gmail.comwrote:
Hi,

I'm a big fan of path.py. One thing that I think is a good idea
is for directories to automatically have a slash appended to them
if it is not automatically added. Eg:

from path import path

dir = path('/some/dir')

x = dir + "file" # should yield /some/dir/file
I emailed the author of path.py but I think he must be extremely
busy. It took him 2-3 weeks to answer my first email and it's
been longer than that for the one I sent regarding this.
just use '/' if that is what you want:
>>from path import path
d=path('/some/dir')
d / "file"
path(u'/some/dir\\file')
>>>
If + also did that, it would be more difficult to change the extension
when renaming a file or whatever.

max

Nov 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.