Python Module

0
6K

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).

Buscar
Categorías
Read More
Ask an Expert
10 mistakes that will kill your expert video
Many experts make these mistakes and lose their audience. But they are easy to avoid - I have put...
By FWhoop Xelqua 2022-10-02 12:01:16 0 34K
Home Automation
Elevate Your Viewing Experience with the Smart Base for your TV
Introducing the Smart Base for TV, the revolutionary device designed to enhance your television...
By Vladimir Tsigrik 2024-11-01 16:46:49 0 6K
Life Issues
Joker. (2019)
A mentally troubled stand-up comedian embarks on a downward spiral that leads to the creation of...
By Leonard Pokrovski 2022-12-31 20:16:41 0 14K
Life Issues
Aladdin (1992)
A kind-hearted street urchin and a power-hungry Grand Vizier vie for a magic lamp that has the...
By Leonard Pokrovski 2023-07-01 19:45:10 0 23K
Социальные проблемы
Мисс Плохое поведение. Misbehaviour. (2020)
Англия, 1970-е, эпоха сексуальной революции и поисков новой свободы. Миллионы восторженных...
By Nikolai Pokryshkin 2022-10-21 17:16:50 0 21K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov