You should use open
with the w+
mode:
file = open('myfile.dat', 'w+')
More Related Contents:
- What do I use on linux to make a python program executable
- OSError: [Error 1] Operation not permitted
- Lazy Method for Reading Big File in Python?
- Reading binary file and looping over each byte
- ImageMagick not authorized to convert PDF to an image
- Pycharm and sys.argv arguments
- Install tkinter for Python
- Python 32-bit memory limits on 64bit windows
- mysql_config not found when installing mysqldb python interface
- Python subprocess.Popen “OSError: [Errno 12] Cannot allocate memory”
- Run Python script at startup in Ubuntu
- What do I need to read Microsoft Access databases using Python?
- How to find the real user home directory using python?
- Create file but if name exists add number
- Cross-platform space remaining on volume using python
- How to open a password protected excel file using python?
- Format of /dev/input/event*
- How to get output from subprocess.Popen(). proc.stdout.readline() blocks, no data prints out
- Use the default Python rather than the Anaconda installation when called from the terminal
- python close file descriptor question
- Understanding python subprocess.check_output’s first argument and shell=True [duplicate]
- Python script as linux service/daemon
- ValueError : I/O operation on closed file
- Listing available devices in python-opencv
- Cron job: how to run a script that requires to open display?
- How to read lines from a file in python starting from the end
- What is different between makedirs and mkdir of os?
- Treat binary data as a file object?
- Unicode encoding for filesystem in Mac OS X not correct in Python?
- How to install and import Python modules at runtime