Because you did from os import *
, you are (accidenally) using os.open, which indeed requires an integer flag instead of a textual “r” or “w”. Take out that line and you’ll get past that error.
More Related Contents:
- Lazy Method for Reading Big File in Python?
- Reading binary file and looping over each byte
- Is it possible to modify lines in a file in-place?
- Generate random integers between 0 and 9
- open() gives FileNotFoundError/IOError: Errno 2 No such file or directory
- Converting integer to string in Python
- Converting integer to binary in python
- Convert floats to ints in Pandas?
- How can I check if a string represents an int, without using try/except?
- How to write a multidimensional array to a text file?
- Read file from line 2 or skip header row
- Python 32-bit memory limits on 64bit windows
- Writing a list to a file with Python, with newlines
- File read using “open()” vs “with open()” [duplicate]
- Convert integer to string in Python
- Create file but if name exists add number
- Safest way to convert float to integer in python?
- How to open a password protected excel file using python?
- pandas to_csv output quoting issue
- Python Pandas: How to read only first n rows of CSV files in?
- How to safely open/close files in python 2.4
- python close file descriptor question
- ValueError : I/O operation on closed file
- Behaviour of truncate() method in Python
- How to read lines from a file in python starting from the end
- Convert all strings in a list to integers
- Convert percent string to float in pandas read_csv
- Round a floating-point number down to the nearest integer?
- How can I convert string values from a dictionary, into int/float datatypes?
- Change file to read-only mode in Python