13 lines
389 B
Python
13 lines
389 B
Python
import sys
|
|
|
|
def obtenir ( option, fallback=False ) :
|
|
'''String -> String/Boolean
|
|
Si l'option demandée n'existe pas, renvoie False.
|
|
Si l'option demandée existe'''
|
|
if option in sys.argv:
|
|
index = sys.argv.index( option ) + 1
|
|
if len( sys.argv ) > index :
|
|
print type( sys.argv[ index - 1 ])
|
|
return sys.argv[ index ]
|
|
return fallback
|