Skip to content

Instantly share code, notes, and snippets.

@pointofpresence
Last active March 31, 2024 21:08
Show Gist options
  • Save pointofpresence/71916dfff8fe0db859e10642327d9092 to your computer and use it in GitHub Desktop.
Save pointofpresence/71916dfff8fe0db859e10642327d9092 to your computer and use it in GitHub Desktop.
Python: Получение аргументов командной строки
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