path.py and directory naming: trailing slash automatic?

Discussion in 'Python' started by metaperl.mogd@gmail.com, Nov 10, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Max Erickson Guest

    "" <> 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
    Max Erickson, Nov 10, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. abcd
    Replies:
    7
    Views:
    343
    Ben Finney
    Mar 15, 2007
  2. Harlan Messinger

    ASP.NET inserts trailing slash in tag

    Harlan Messinger, Feb 18, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    467
    Harlan Messinger
    Feb 19, 2008
  3. Jeff Mitchell

    trailing slash issue in Find.find

    Jeff Mitchell, Aug 24, 2003, in forum: Ruby
    Replies:
    0
    Views:
    102
    Jeff Mitchell
    Aug 24, 2003
  4. Stan Brown
    Replies:
    6
    Views:
    366
    Stan Brown
    Oct 29, 2003
  5. Sebastian Bauer

    HTTP::Request, trailing slash

    Sebastian Bauer, Jun 29, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    172
    Sebastian Bauer
    Jul 1, 2004
Loading...

Share This Page