()
| 7 | from os import path |
| 8 | |
| 9 | def main(): |
| 10 | # make a duplicate of an existing file |
| 11 | if path.exists("textfile.txt"): |
| 12 | # get the path to the file in the current directory |
| 13 | |
| 14 | # let's make a backup copy by appending "bak" to the name |
| 15 | |
| 16 | # rename the original file |
| 17 | |
| 18 | # now put things into a ZIP archive |
| 19 | |
| 20 | # more fine-grained control over ZIP files |
| 21 | |
| 22 | |
| 23 | if __name__ == "__main__": |