Skip to content

Instantly share code, notes, and snippets.

@DalyaG
Last active January 7, 2021 11:07
Show Gist options
  • Save DalyaG/9a6e2e58d95690031ad14c3f06ae343d to your computer and use it in GitHub Desktop.
Save DalyaG/9a6e2e58d95690031ad14c3f06ae343d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from optparse import OptionParser
from my_project import MyProject
from my_project_params import Params
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-s", "--src_path",
help="Location of data, by default you should run from this folder. default='.'.")
parser.add_option("--mg", "--some_magic_number", dest="some_magic_number",
type="float",
help="In some very internal component we use this magic number because it works. "
"Only change this if tou REALLY know what you are doing. Default = -3.1.")
parser.add_option("--lp", "--some_list_param_str", dest="some_list_param_str",
type="str",
help="Default: '1,2.2,3' which is then translated to some_list_param = [1, 2.2, 3]. "
"Use this to change the default value of some_list_param by supplllying comma separated values.")
parser.add_option("--ui", "--user_input", dest="user_input",
type="int",
help="A mandatory input from the user")
params = Params.from_parser(parser)
my_project = MyProject(params)
my_project.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment