Created
March 4, 2023 17:32
-
-
Save MatthewJDavis/07ff817b79348d3ff7a19745a82f7983 to your computer and use it in GitHub Desktop.
Print out input text from command line argument and exit.
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
# 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