Hi I am trying to apply prefect to my project which is using the library click
in dealing with command-line paras. Below is a demo code snippet:
@click.command()
@click.option(
"-p",
"--pages",
type=int,
default=0,
help="...",
)
def main(pages):
print("Running...")
if pages > 0:
a()
else:
b()
print("Finished without errors.")
if __name__ == "__main__":
main()
another_method()
The doc of prefect mentioned about the example :
flow = Flow("hello-flow", tasks=[hello_task])
flow.register(project_name="tester")
But what if I need to run the program by let say poetry run main.py -p 10
, where I need to give a fixed command-line para and also run with poetry. In that case how should I organize or refactor my code to fit with Prefect?