Python Module

0
8K

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

Search
Categories
Read More
Dentistry
How to take care of your teeth
How to take care of your teeth 1. Correct and regular brushing technique Simply...
By Leonard Pokrovski 2024-04-15 20:27:32 0 11K
Life Issues
The Elephant Man. (1980)
A Victorian surgeon rescues a heavily disfigured man who is mistreated while scraping a living as...
By Leonard Pokrovski 2023-03-01 17:36:28 0 14K
Internet Broadcasts
The Rise of Internet Broadcasting: Transforming Media Consumption
In recent years, internet broadcasting has revolutionized the way we consume media, enabling a...
By Dacey Rankins 2024-10-17 19:08:56 0 21K
Cricket
The Timeless Appeal of Cricket: A Sport Steeped in Tradition and Excitement
Cricket, often described as a gentleman’s game, holds a unique place in the world of...
By Dacey Rankins 2024-06-19 16:55:05 0 10K
Yard, Deck, and Table Games
Why Do Children Play Yard Games in the Modern World
Why should children play yard games? Modern children are increasingly spending their free time...
By Dacey Rankins 2024-04-09 14:40:39 0 9K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov