Python Module

0
9KB

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
Programming
JavaScript Integer Value Limit
The value of the MAX SAFE INTEGER constant is 9007199254740991 (9,007,199,254,740,991 or nine...
Por Jesse Thomas 2023-05-25 19:29:21 0 9KB
Newspapers
10 MOST WIDELY READ NEWSPAPERS IN THE WORLD
Over time, it becomes important for newspaper owners to publish their contents in accordance with...
Por FWhoop Xelqua 2022-11-02 13:33:41 0 33KB
История
Апокалипсис сегодня. Apocalypse Now. (1979)
Во время Вьетнамской войны капитан Уиллард отправляется вверх по реке в Камбоджу со спецзаданием:...
Por Nikolai Pokryshkin 2022-12-11 18:22:10 0 28KB
Business
What Are the Most Critical Decisions You Make as a Manager?
As a manager, your role comes with a wide range of responsibilities—but not all decisions...
Por Dacey Rankins 2025-05-13 16:36:00 0 4KB
Телевидение
Прямой эфир ТНТ4.
ТНТ4 — федеральный тематический телеканал с целевой аудиторией 14 – 44, начавший...
Por Nikolai Pokryshkin 2022-10-02 08:04:15 1 32KB

BigMoney.VIP Powered by Hosting Pokrov