Please enable JavaScript.
Coggle requires JavaScript to display documents.
Working with program files in Python, Read, write and append flow,…
-
Read, write and append flow
-
Creating files flow
Like editing a file pass either the "a" or "w" option to open() and the file will be created automatically as named.
-
File management flow
import the "os" library
Getting file info is possible with stat() and the filename which can return: size, access time, modification time etc
-
Access time is accessed with "st_atime" and outputs to unix time - use the datetime library and "fromtimestamp() for something readable.
Modification time is accessed with "st_mtime" and outputs to unix time - use the datetime library and "fromtimestamp() for something readable.
-