Last active
March 31, 2024 21:08
-
-
Save pointofpresence/71916dfff8fe0db859e10642327d9092 to your computer and use it in GitHub Desktop.
Python: Получение аргументов командной строки
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
import getopt | |
import sys | |
argv = sys.argv[1:] | |
opts, args = getopt.getopt(argv, 'x:y:') | |
# list of options tuple (opt, value) | |
print(f'Options Tuple is {opts}') | |
# list of remaining command-line arguments | |
print(f'Additional Command-line arguments list is {args}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment