SEEK_SET defined?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Roger Miller

    #1

    SEEK_SET defined?

    I see that the posixfile module is deprecated. Have the SEEK_SET, etc.
    constants moved somewhere else, or do I need to define them myself?

  • Peter Hansen

    #2
    Re: SEEK_SET defined?

    Roger Miller wrote:[color=blue]
    > I see that the posixfile module is deprecated. Have the SEEK_SET, etc.
    > constants moved somewhere else, or do I need to define them myself?[/color]

    In Python 2.5 they have been added to the os module, but for now I think
    you are probably expected to just continue using posixfile or define
    them yourself.

    If you did define them yourself, maybe this would be best, given the
    current situation:

    import os
    try:
    os.SEEK_SET
    except AttributeError:
    os.SEEK_SET, os.SEEK_CUR, os.SEEK_END = range(3)

    -Peter

    Comment

    Working...