You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REALLY good idea.
I like the implementation of the Symfony console: https://github.com/symfony/Console
This is a PHP project which is kindly the same as this idea.
Maybe we can port this to Python?
Or is there something similar in Python itselfs?
Am Freitag, 14. Februar 2014 schrieb Germán Poo-Caamaño :
Slightly related to #16#16,
it would be nice to have operations with mlstats to make it simpler yet
powerful. For example,
I have never tried that. By looking at the repository it seems a bit overkill. I would go for something simpler, like argparse. Take a look at the following snippet:
defmain():
arger=argparse.ArgumentParser()
# Arguments for top-level, e.g "subcmds.py -v"arger.add_argument("-v", "--verbose", action="count", default=0)
subparsers=arger.add_subparsers(dest="command")
# Make parser for "subcmds.py report ..."report_parser=subparsers.add_parser("report")
report_parser.add_argument("-m", "--moo", dest="moo")
# Make parser for "subcmds.py parse ..."parse_parser=subparsers.add_parser("parse")
parse_parser.add_argument("url", nargs="+")
# Parseopts=arger.parse_args()
# Print option object for old-school debuggingprintoptsifopts.command=="report":
print"Report command"print"--moo was %s"%opts.mooelifopts.command=="parse":
print"url: %s"%opts.urlelse:
# argparse will error on unexpected commands, but# in case we mistype one of the elif statements...raiseValueError("Unhandled command %s"%opts.command)
Slightly related to #16, it would be nice to have operations with
mlstats
to make it simpler yet powerful. For example,I am unsure about the commands yet, but splitting the operation of connecting and creating the database made me think about this.
The text was updated successfully, but these errors were encountered: