Difference between revisions of "Argparse"

From wikieduonline
Jump to navigation Jump to search
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{lc}}
 
[[wikipedia:Argparse]]
 
[[wikipedia:Argparse]]
 +
* https://docs.python.org/3/library/argparse.html
 +
 +
* Action: https://docs.python.org/3/library/argparse.html#action
 +
store_true
 +
  
[[optparse]]
 
  
 
  [[import argparse]]
 
  [[import argparse]]
 +
parser = [[argparse.ArgumentParser]] (allow_abbrev=False, usage=usage())
  
  parser = [[argparse.ArgumentParser]](allow_abbrev=False, usage=usage())
+
parser.add_argument("your_argument")
 +
args = parser.parse_args()
  
 +
== Related ==
 +
* <code>[[optparse]] (deprecated)</code>
 +
* <code>[[import sys]]</code>
  
 
== See also ==
 
== See also ==
 +
* {{import}}
 
* {{argparse}}
 
* {{argparse}}
* {{Python}}
 
  
 
[[Category:Python]]
 
[[Category:Python]]

Latest revision as of 12:17, 27 March 2024

Advertising: