Python Module

0
8K

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
Искусство, культура и развлечения
Амадей. Amadeus. (1984)
1781 год. Антонио Сальери успешно справляется с обязанностями придворного композитора при...
By Nikolai Pokryshkin 2022-12-27 17:57:07 0 28K
Жизненные вопросы
Клаус. Klaus. (2019)
Владелец почтовой империи, чтобы научить ленивого отпрыска по имени Джеспер уму-разуму,...
By Nikolai Pokryshkin 2023-03-18 11:47:08 0 25K
История
Телохранитель. Yojimbo. (1961)
В некий японский городок приходит самурай. Самурай выглядит совершенно не по-самурайски: плохо...
By Nikolai Pokryshkin 2023-02-19 14:43:31 0 17K
Financial Services
The Production Possibilities Frontier
Key Points The Production Possibilities Frontier (PPF) is a graph that shows all the...
By Mark Lorenzo 2023-06-23 19:45:38 0 8K
Television
Fox 4 Live TV. Dallas, Texas, United States.
Fox Dallas (KDFW), is a Fox-affiliated television station located in Dallas, Texas, United...
By Nikolai Pokryshkin 2022-10-19 09:54:56 0 27K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov