Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > path.py and directory naming: trailing slash automatic?

Reply
Thread Tools

path.py and directory naming: trailing slash automatic?

 
 
metaperl.mogd@gmail.com
Guest
Posts: n/a
 
      11-10-2006
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.

 
Reply With Quote
 
 
 
 
Max Erickson
Guest
Posts: n/a
 
      11-10-2006
"(E-Mail Removed)" <(E-Mail Removed)> wrote:

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET inserts trailing slash in tag Harlan Messinger ASP .Net 4 02-19-2008 01:15 PM
Multiline code - trailing slash usage abcd Python 7 03-15-2007 04:27 PM
HTTP::Request, trailing slash Sebastian Bauer Perl Misc 9 07-01-2004 06:19 PM
Finding out if a string has a trailing slash Stan Brown Perl Misc 6 10-29-2003 03:09 PM
trailing slash issue in Find.find Jeff Mitchell Ruby 0 08-23-2003 11:30 PM



Advertisments