Python-based File Write Operation
(Redirected from Python File Write Operation)
Jump to navigation
Jump to search
A Python-based File Write Operation is a file write operation that is a Python file operation.
- Context:
- …
- Example(s):
...
- Counter-Example(s):
- See: Python Coding Example.
References
2018
outputFileText = "Here's some text to save in a file" open("testit.txt", "w").write(outputFileText)
Append to a file requires the second parameter of open() to be "a" (from append):
outputFileText = "Here's some text to add to the existing file." open("testit.txt", "a").write(outputFileText)