Python Module

0
5K

If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Therefore, if you want to write a somewhat longer program, you are better off using a text editor to prepare the input for the interpreter and running it with that file as input instead. This is known as creating a script. As your program gets longer, you may want to split it into several files for easier maintenance. You may also want to use a handy function that you’ve written in several programs without copying its definition into each program.

To support this, Python has a way to put definitions in a file and use them in a script or in an interactive instance of the interpreter. Such a file is called a module; definitions from a module can be imported into other modules or into the main module (the collection of variables that you have access to in a script executed at the top level and in calculator mode).

Search
Categories
Read More
Financial Services
Law of supply
Key points The law of supply states that a higher price leads to a higher...
By Mark Lorenzo 2023-04-07 20:57:24 0 5K
Programming
Python Sanic
In my previous post, I've made a short explanation of what FastAPI does. I've found another...
By Jesse Thomas 2023-02-02 21:03:10 0 5K
Financial Services
Decisions with a budged constraint
Key points The budget constraint is the boundary of...
By Mark Lorenzo 2023-02-13 15:15:43 0 7K
Media
Spotlight. (2015)
The true story of how the Boston Globe uncovered the massive scandal of child molestation and...
By Leonard Pokrovski 2023-04-19 20:19:05 0 13K
Gifts
What to give in the New Year of the Black Rabbit 2023: ideas
The coming year 2023 according to the Eastern calendar will be the year of the Black Water...
By FWhoop Xelqua 2022-12-20 15:13:11 0 14K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov