python modules tutorial
Python hosting: Host, run, and code Python in the cloud!
Modular programming
As you are programming, the software can quickly scale into a large code base. To manage complexity we can use classes, functions and modules.
Related course
Python Programming Bootcamp: Go from zero to hero
Module content
To show the accessible functions (and included variables) in a module, you can use this code:
#!/usr/bin/env python |
Result:
|
Create a Module
You can create your own module in these steps:
Create a file called test.py (your module)
#!/usr/bin/env python |
Then create a file called app.py:
from test import * |
Related course
Python Programming Bootcamp: Go from zero to hero
Posted in beginner
Leave a Reply: