Skip to content

Instantly share code, notes, and snippets.

@MatthewJDavis
Created March 4, 2023 17:32
Show Gist options
  • Save MatthewJDavis/07ff817b79348d3ff7a19745a82f7983 to your computer and use it in GitHub Desktop.
Save MatthewJDavis/07ff817b79348d3ff7a19745a82f7983 to your computer and use it in GitHub Desktop.
Print out input text from command line argument and exit.
# Print out input text from command line argument and exit.
# Used as demo to get data from Python Script in PowerShell.
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument("text")
args = parser.parse_args()
print(f"{args.text} From Python script.")
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment