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

Suche
Kategorien
Mehr lesen
Horror
Aliens. (1986)
Fifty-seven years after surviving an apocalyptic attack aboard her space vessel by merciless...
Von Leonard Pokrovski 2022-12-22 21:11:51 0 36KB
Internet
Engaging Post Ideas That Will Boost Your Social Media Engagement
In today's digital world, where information literally overwhelms us from all sides, competition...
Von FWhoop Xelqua 2023-06-07 14:36:59 0 22KB
Business
How Do I Structure a Speech?
One of the most common challenges in public speaking is structuring a speech. You might have...
Von Dacey Rankins 2025-12-10 17:48:05 0 2KB
Fishing
The Thrill of Fishing: A Sport for Nature Enthusiasts
The Thrill of Fishing: A Sport for Nature Enthusiasts Fishing, often regarded as more than just...
Von Leonard Pokrovski 2024-06-25 16:58:46 0 22KB
Business
How Detailed Should a Startup Biography Be?
When crafting a startup biography, one common question arises: How much detail is too much? The...
Von Dacey Rankins 2025-04-19 14:47:47 0 11KB

BigMoney.VIP Powered by Hosting Pokrov