Python Module

0
7K

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

Cerca
Categorie
Leggi tutto
Телевидение
Телеканала «Краснодар», прямой эфир
МТРК «Краснодар» - динамично развивающийся телеканал, рассказывающий о событиях и...
By Nikolai Pokryshkin 2022-10-29 13:00:12 0 18K
Business
Actionable Metrics vs. Vanity Metrics: Understanding the Difference
In today's data-driven world, businesses rely on metrics to measure performance and make informed...
By Dacey Rankins 2025-03-10 17:12:38 0 3K
Periods and Movements
Art periods
As long as we humans can use our hands, we create art. From the early cave paintings to the...
By FWhoop Xelqua 2023-07-11 18:46:08 0 19K
Financial Services
The economics of pollution
Key Points Economic production can cause environmental damage. This tradeoff...
By Mark Lorenzo 2023-07-20 18:29:02 0 9K
Спорт
Сестры на старте. Sisters on Track. (2021)
Документальный фильм Netflix "Sisters On Track" - это дико аутентичная история взросления трех...
By Nikolai Pokryshkin 2022-09-03 20:46:51 0 27K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov