This is a gist where you can find handy Python Functions for your projects!
Feel free to use them! ;D
Last active
April 29, 2022 15:56
-
-
Save Aetopia/98e398d52da38191ac346fe598df82dd to your computer and use it in GitHub Desktop.
Python Functions
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
# Clear all of the text within the terminal, Python is running in. | |
def clear(): | |
""" | |
Clears the terminal. | |
""" | |
if system() == 'Windows': | |
clear = 'cls' | |
else: | |
clear = 'clear' | |
run(clear, shell = True) |
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
# Vanilla pause function for Python! | |
from time import sleep | |
def pause(msg: str = 'Press Ctrl + C to continue...'): | |
""" | |
Suspends the executing script, to continue execution press Ctrl + C. | |
Default Message -> "Press Ctrl + C to continue..." | |
""" | |
if msg != None: | |
print(msg) | |
while True: | |
try: | |
sleep(1) | |
except KeyboardInterrupt: | |
break |
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
print('Remote Script!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment