From e4dcfb6f98591005bc2a8be6352ce4234e5cbd26 Mon Sep 17 00:00:00 2001 From: jbcodeforce Date: Mon, 3 Jun 2024 15:19:53 -0700 Subject: [PATCH] add ref to getops --- docs/python/faq.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/python/faq.md b/docs/python/faq.md index 575b702..c320281 100644 --- a/docs/python/faq.md +++ b/docs/python/faq.md @@ -9,12 +9,14 @@ pipenv acts as pip + virtual environment. It uses Pipfile to replace requirement ## How to get program arguments? +See [getopt](https://docs.python.org/3/library/getopt.html) + ```python import sys,getopt USER="jbcodeforce" FILE="./data/export-questions.json" try: - opts, args = getopt.getopt(argv,"hi:u:",["inputfile=","user="]) + opts, args = getopt.getopt(sys.argv,"hi:u:",["inputfile=","user="]) except getopt.GetoptError: print(usage()) sys.exit(2)