where is os.path.expanduser?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin F

    #1

    where is os.path.expanduser?

    where is this code looking for the .imap file? I am on OSX and am not
    sure where to put the file it is looking for.

    f = open(os.path.ex panduser('~/.imap'))
  • Peter Otten

    #2
    Re: where is os.path.expandu ser?

    Kevin F wrote:
    [color=blue]
    > where is this code looking for the .imap file? I am on OSX and am not
    > sure where to put the file it is looking for.
    >
    > f = open(os.path.ex panduser('~/.imap'))[/color]

    Your interactive interpreter has the answer
    [color=blue][color=green][color=darkred]
    >>> import os
    >>> os.path.expandu ser("~")[/color][/color][/color]
    '/home/peter'

    that will most likely differ from the one given above.

    Peter

    Comment

    • Kevin F

      #3
      Re: where is os.path.expandu ser?

      Peter Otten wrote:[color=blue]
      > Kevin F wrote:
      >[color=green]
      >> where is this code looking for the .imap file? I am on OSX and am not
      >> sure where to put the file it is looking for.
      >>
      >> f = open(os.path.ex panduser('~/.imap'))[/color]
      >
      > Your interactive interpreter has the answer
      >[color=green][color=darkred]
      >>>> import os
      >>>> os.path.expandu ser("~")[/color][/color]
      > '/home/peter'
      >
      > that will most likely differ from the one given above.
      >
      > Peter[/color]
      thanks

      Comment

      Working...