Python Module

0
8Кб

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

Поиск
Категории
Больше
Business
Microservices: What They Are and What Are Their Benefits
Until about 2013, companies typically developed enterprise applications as single modules with a...
От Dacey Rankins 2024-09-26 18:26:11 0 27Кб
Искусство, культура и развлечения
Никто не знает, что я здесь. Nobody Knows I'm Here. (2020)
Мемо Гарридо живет в уединении на чилийской овцеводческой ферме. В прошлом он известный певец,...
От Nikolai Pokryshkin 2022-10-01 21:08:16 0 20Кб
Programming
Python UnicodeError
In Python, Unicode standards have two types of error: Unicode encodes error and Unicode decode...
От Jesse Thomas 2023-03-31 20:38:35 0 8Кб
Sport
14 Peaks: Nothing Is Impossible (2021)
Fearless Nepali mountaineer Nirmal Purja embarks on a seemingly impossible quest to summit all 14...
От Leonard Pokrovski 2023-07-29 20:33:08 0 529Кб
Business
Marketing plan - types, development, examples
What is a marketing plan, what types does it include, how to develop and use it? In this article,...
От Dacey Rankins 2024-09-05 17:23:09 0 8Кб
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov