mirror of
https://github.com/kennethreitz-archive/plac.git
synced 2026-06-05 15:40:17 +00:00
13 lines
240 B
Python
13 lines
240 B
Python
# example2.py
|
|
def main(dsn):
|
|
"Do something on the database"
|
|
print(dsn)
|
|
# ...
|
|
|
|
if __name__ == '__main__':
|
|
import argparse
|
|
p = argparse.ArgumentParser()
|
|
p.add_argument('dsn')
|
|
arg = p.parse_args()
|
|
main(arg.dsn)
|