ERROR: [Errno 22] Invalid argument:
Method 1: Incorrect input format
f = open('F:\Python 3.6\test.txt','r')
It should be modified to:
f = open('f:\\Python 3.6\\test.txt','r')
Or:
f = open('f:/Python 3.6/test.txt','r')
Change \ to /, or \\, because \t is a newline character in Python and is not recognized.
Method two :(I made a mistake here)
It is best to enter the path manually rather than copy and paste the changes directly.
Read More:
- Error reported in Python reading file oserror: [errno 22] invalid argument: ‘u202ac: \ \ users \ \ yyqhk \ \ desktop \ \ 1. CSV’
- Solve the oserror: [errno 22] invalid argument: ‘u202ad’ in Python
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- Solution to the problem that SQL database query result field contains new line character, which leads to copy to excel dislocation
- Solution of CONDA (PIP) bad interpreter
- (Copy python package, the problem generated) pip Fatal error in launcher: Unable to create process using
- Python-OSError: [Errno 22]
- Can’t multiply sequence by non int of type ‘float’
- Illegalargumentexception error when adding cookie to response
- Syntax error near unexpected token ‘$’Do is reported when running bash file
- Package python3.1 + PyQt4 into exe
- Differences between VI and VIM in Linux
- python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: trunca
- PIP report failed to create process
- Installation and use of graphviz under mac
- ValueError: not enough values to unpack (expected 2, got 0)
- [Python] error syntax error: summary of solutions to invalid syntax
- python reads csv file is an error _csv.Error: iterator should return strings, not bytes (did you open the file in text)
- Python error: pandas.errors.ParserError: Error tokenizing data. C error: Expected 3……
- Spoop export hive to MySQL