This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import random | |
import time | |
def main(): | |
while True: | |
choice = input( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
class FileTracker(object): | |
def __init__(self, filename): | |
self._cached_stamp = 0 | |
self.filename = filename | |
def is_modified(self): | |
stamp = os.stat(self.filename).st_mtime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"if": { | |
"prefix": "if", | |
"body": [ | |
"if ${1:expression}:", | |
"\t${2:pass}" | |
], | |
"description": "Code snippet for an if statement" | |
}, | |
"if/else": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
def fileMaker(start, end, name, extension, folder_path) -> None: | |
path = Path(folder_path) | |
if path.exists() and path.is_dir(): | |
for serial in range(start, end + 1): | |
file_name = f"{name} {serial:0>2d}{extension}" | |
file = path.joinpath(file_name) | |
with open(file, "w") as f: |