Python Module

0
6KB

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

Rechercher
Catégories
Lire la suite
Social Issues
The Great Dictator. (1940)
Dictator Adenoid Hynkel tries to expand his empire while a poor Jewish barber tries to avoid...
Par Leonard Pokrovski 2022-12-21 19:24:05 0 14KB
Cartes
Armenia on the Babylonian Map
What do we know about the oldest maps of the world that have survived to this day. There are only...
Par FWhoop Xelqua 2022-12-14 13:50:09 0 14KB
Nature and Science
Princess Mononoke. (1997)
On a journey to find the cure for a Tatarigami's curse, Ashitaka finds himself in the middle of a...
Par Leonard Pokrovski 2023-01-04 20:54:21 0 14KB
Guns
The Complex and Controversial World of Guns: A Global Perspective
Guns have played a significant role in shaping human history, from ancient weaponry used for...
Par Dacey Rankins 2024-12-06 15:45:40 0 5KB
Health
13 gift options for a person leading a healthy lifestyle
Leading a healthy lifestyle has become a fashionable trend among the population of the whole...
Par FWhoop Xelqua 2022-10-17 13:05:47 0 32KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov