python
[Python] Save (write) data to file
myfile = open('hello.txt', 'w')
myfile.write('Hello world')
myfile.close()
Output
hello.txt:
Hello world
Hello world
Was this helpful?
Similar Posts
- Create or save object data in Django
- convert pyqt5 resource file .qrs to python file?
- Install dependencies using pip from requirement.txt file in Python
- How to read a JSON file in Python
- How to get current file path in Python
- Send post request with data and headers Python requests
- Read JSON data in python