- How to check if a file exists?
- How to add text to a file?
I know how to create a file, but in this case it overwrites all the data:
import io with open('text.txt', 'w', encoding='utf-8') as file: file.write('text!')
In *nix
I can do something like:
#!/bin/sh if [ -f text.txt ]
tomas source share