CommencerCommencer gratuitement

Sibling imports

The module you documented in the last exercise, impyrial, is growing and you have separated the private functions (the ones you don't really want your users to use) from your public functions. The private functions are in the core.py module and the public ones are in the api.py module.

However, you need to use the private functions to make the public functions work. In this exercise, you will import them into the api.py module to get your package modules working together.

Note: Please make sure that you run the example_script.py. If you run the api.py file, you get an ModuleNotFoundError: No module named 'impyrial' as is expected.

Remember that you can open/close the folder and files overview by clicking on the icon on the left side of the editor highlighted in red. Icon with multiple files

Cet exercice fait partie du cours

Developing Python Packages

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice