Skip to content

Instantly share code, notes, and snippets.

@bacarpenter
Last active January 22, 2021 18:42
Show Gist options
  • Save bacarpenter/3945f4e1292da0c10dcad56d6d73e641 to your computer and use it in GitHub Desktop.
Save bacarpenter/3945f4e1292da0c10dcad56d6d73e641 to your computer and use it in GitHub Desktop.
scripts.py
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)"""
@bacarpenter
Copy link
Author

Scripts.py

A script for launching personal automation scripts from other places on the file system. It works on files other than python too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment