Python Module

0
9Кб

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

Поиск
Категории
Больше
Mental Health
ADHD: Genetics
ADHD has a high heritability of 74%, meaning that 74% of the presence of ADHD in the population...
От Kelsey Rodriguez 2023-04-04 16:53:48 0 10Кб
Digital
The Evolution and Impact of Digital Design
Introduction In the age of technology, digital design has become an integral part of our daily...
От Dacey Rankins 2024-10-07 17:02:34 0 16Кб
Телевидение
Телеканал UniverTV прямая трансляция.
Первый и, на сегодня, единственный в России круглосуточный университетский студенческий телеканал...
От Nikolai Pokryshkin 2022-11-09 11:01:43 0 25Кб
Business
What is Business Strategy? A Clear Definition and Examples
Business strategy is a crucial concept that defines how a company will achieve its long-term...
От Dacey Rankins 2024-12-23 16:01:27 0 8Кб
Business
What Types of Content Resonate Most with Audiences on Different Platforms?
In the world of content creation, understanding the type of content that resonates with your...
От Dacey Rankins 2025-02-18 15:16:46 0 8Кб

BigMoney.VIP Powered by Hosting Pokrov