Python Module

0
5K

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
История
1917. (2019)
6 апреля 1917 года, разгар Первой мировой войны, Западный фронт на севере Франции. Британский...
By Nikolai Pokryshkin 2023-02-01 22:53:04 0 28K
Literature
The Power of Literature: Exploring the Depths of Human Experience
Literature is one of humanity's most cherished and enduring forms of expression. It encompasses...
By Dacey Rankins 2024-12-13 14:28:38 0 2K
Социальные проблемы
Схватка. Heat. (1995)
Нил МакКоли - один из лучших преступников Лос-Анджелеса. Ему противостоит лучший детектив Винсент...
By Nikolai Pokryshkin 2023-01-25 08:47:11 0 14K
Business
Is There a Market for My Product or Service?
Before launching any business, one of the most important questions to ask is whether there is a...
By Dacey Rankins 2025-02-06 15:04:13 0 3K
Open Source
Open Source Code
Open Source is software distributed as open source. Such an application can be modified...
By Dacey Rankins 2024-03-27 17:47:08 0 15K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov