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

Site içinde arama yapın
Kategoriler
Read More
Archives
Navigating the Archives: Understanding the Importance of References
Navigating the Archives: Understanding the Importance of References Archives serve as invaluable...
By Leonard Pokrovski 2024-05-17 00:03:05 0 17K
Gambling
The Complex World of Gambling: Risks, Rewards, and Responsible Play
Gambling, the act of risking money or valuables on an uncertain outcome with the primary...
By Dacey Rankins 2024-11-27 14:18:57 0 10K
Music
Music genres
There are only four musical directions: folk music, sacred music, academic music and popular...
By FWhoop Xelqua 2023-07-07 17:09:02 0 22K
Social Issues
Misbehaviour. (2020)
A group of women hatch a plan to disrupt the 1970 Miss World beauty competition in London. My...
By Leonard Pokrovski 2022-10-27 22:16:16 0 26K
Business
How do I handle issues related to content strikes or demonetization?
As a content creator, dealing with content strikes or demonetization can be a frustrating and...
By Dacey Rankins 2025-02-21 15:15:17 0 10K

BigMoney.VIP Powered by Hosting Pokrov