0

Well, I'm a begginer in Python coding, and at DaniWeb. My problem is: I can't open any files!

I tried:

>>> f = open('C:\teste.txt', 'w')

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    f = open('C:\teste.txt', 'w')
IOError: [Errno 22] invalid mode ('w') or filename: 'C:\teste.txt'
>>> f = 'C:\teste.txt'
>>> open(f)

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    open(f)
IOError: [Errno 22] invalid mode ('r') or filename: 'C:\teste.txt'
>>> open ('C:\teste.txt', 'r')

Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    open('C:\teste.txt', 'r')
IOError: [Errno 22] invalid mode ('r') or filename: 'C:\teste.txt'

Tried in Python Shell & Cmm Line...
Using Python 2.6.4 for WinXp installed in C:\Python 26

Edited by Hawkeye Python: n/a

2
Contributors
2
Replies
5
Views
7 Years
Discussion Span
Last Post by Hawkeye Python
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.