tab error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Edgar Meyer
    New Member
    • Nov 2011
    • 1

    tab error

    whay does this line give an error:

    for line in file.readlines( ):

    thanks,
    E/M/
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Without knowing what the error message is, I could only speculate. file is a built-in function. Could this be the problem?
    Code:
    >>> file.readlines()
    Traceback (most recent call last):
      File "<interactive input>", line 1, in <module>
    TypeError: descriptor 'readlines' of 'file' object needs an argument
    >>>

    Comment

    Working...