Login and get codingIn the previous Bite, you learned how to create an application and added several commands for that app.
Now, let's create some subcommands to further organize your application, see the subcommands documentation.
Create a subcommand "algorithm" from which further subcommands "sum", "subtract", ... can be run as following:
$ python script.py algo sum
$ python script.py algo substractWe already reorganized the code for you into
algorithms.py
andcomparison.py
, which both contain the function and command definitions from the previous exercise.Note: Due to the how the platform works with AWS Lambda, mentioned modules will be downloaded and added to
/tmp
which is being appended tosys.path
so they can be imported.All you need to do is to add the applications (Typer
app
instances) fromalgorithms.py
andcomparison.py
into a single application using theapp.add_typer()
method.Enjoy!
27 out of 29 users completed this Bite.
Will you be the 28th person to crack this Bite?
Resolution time: ~37 min. (avg. submissions of 5-240 min.)