>>> file=open('/tmp/haha.haha','w') >>> file.read() Traceback (most recent call last): File "" , line 1, in <module>; IOError: [Errno 9] Bad file descriptor >>> file=open('/tmp/haha.haha','w') >>> for line in file: >>> print line Traceback (most recent call last): File "" , line 1, in <module> IOError: [Errno 9] Bad file descriptor **You can't open a writable file for read.
沒有留言:
張貼留言