Python Module

0
12KB

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

Pesquisar
Categorias
Leia mais
История
Монти Пайтон и священный Грааль. Monty Python and the Holy Grail. (1975)
Король Артур и рыцари Круглого стола отправляются в невероятное путешествие на поиски Святого...
Por Nikolai Pokryshkin 2023-02-20 12:30:09 0 27KB
Food
Kinder Joy
Kinder Joy (formerly known as Kinder Merendero in Italy and Bahrain) is a candy made by Italian...
Por FWhoop Xelqua 2023-04-24 16:44:48 0 15KB
Personal Finance
Homeownership and Personal Finance: A Comprehensive Guide to Financial Success
Homeownership is often considered a major milestone in life,...
Por Dacey Rankins 2024-12-09 14:27:17 0 13KB
Food
Best Foods for Weight Loss
Studies have shown that certain foods can affect appetite, so they may be beneficial for weight...
Por FWhoop Xelqua 2022-09-21 14:00:25 0 30KB
Телевидение
Христианский телеканал GNC
GNC — Первый Христианский спутниковый телеканал на русском и украинском языках,...
Por Nikolai Pokryshkin 2022-08-30 10:47:57 0 28KB

BigMoney.VIP Powered by Hosting Pokrov