Last active
January 22, 2021 18:42
-
-
Save bacarpenter/3945f4e1292da0c10dcad56d6d73e641 to your computer and use it in GitHub Desktop.
scripts.py
This file contains 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 rich import print | |
import os | |
def mergePdf(): | |
os.system("python3 ~/scripts/mergePdf/mergePdf.py") | |
def pdataHash(): | |
os.system("node /Users/bencarpenter/Code/pdata-hash/testHash.js") | |
# Welcome | |
print("[bold green]Scripts Menu[/bold green] | Ben Carpenter, 2021") | |
print("----------------------------------") | |
# Menu | |
print("Which script would you like to run?") | |
scripts = [mergePdf, pdataHash] | |
i = 0 | |
for script in scripts: | |
print(f"[bold][{i}][/bold]: {script.__name__}") | |
i += 1 | |
input = int(input("Option: ")) | |
# Run option: | |
scripts[input]() | |
"""try: | |
scripts[input]() | |
except: | |
print("[bold red]Error! Try again.[/bold red]") | |
exit(1)""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scripts.py
A script for launching personal automation scripts from other places on the file system. It works on files other than python too!