Python Module

0
11K

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
Finance
How Much Foreign Currency Can One Carry Abroad? Understanding Forex Limits
How Much Foreign Currency Can One Carry Abroad? Understanding Forex Limits Traveling...
By Leonard Pokrovski 2025-10-17 08:15:14 0 2K
Persone
50 artists that left a mark in history
50 artists and their works that have left a mark on history and people's hearts...
By FWhoop Xelqua 2023-07-09 18:10:51 0 30K
Mental Health
Psychosis: Neurobiology
Psychosis has been traditionally linked to the overactivity of the neurotransmitter dopamine. In...
By Kelsey Rodriguez 2023-06-08 18:02:57 0 11K
Arts, Culture and Entertainment
Crescendo (2020)
An outwardly ambitious and charismatic opera singer fights to maintain her stature while silently...
By Leonard Pokrovski 2022-10-02 20:28:40 0 29K
Business
What Are Best Practices for Leading One-on-One Meetings?
One-on-one meetings are more than status updates — they’re vital touchpoints for...
By Dacey Rankins 2025-06-02 16:12:39 0 7K

BigMoney.VIP Powered by Hosting Pokrov