My system is :win7+python3.4  .

I want to write a new file "named names.txt"  in disk f:

 >>> ff=open(r"F:\names.txt","w")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'F:\\names.txt'
>>> ff=open(r"F:/names.txt","w")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'F:/names.txt'
>>> ff=open(r"F://names.txt","w")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'F://names.txt'
>>> ff=open(r"f://names.txt","w")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'f://names.txt'
>>> ff=open(r"f:/names.txt","w")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'f:/names.txt'

which is the right  file path format in python3.4 ?
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to