Python Module

0
6K

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
История
Лоуренс Аравийский. Lawrence of Arabia. (1962)
Фильм рассказывает о легендарном герое Первой мировой войны - английском разведчике Т.Э....
By Nikolai Pokryshkin 2023-01-15 11:03:53 0 17K
Crafts
Exploring the Charm of Craft Shopping: A Journey into Creativity and Authenticity
Exploring the Charm of Craft Shopping: A Journey into Creativity and Authenticity In the...
By Leonard Pokrovski 2024-05-28 22:50:38 0 16K
Horror
Survival Island. (2005)
Three people - a rich couple and a crew member - are shipwrecked on a tropical island and their...
By Leonard Pokrovski 2023-04-28 19:26:28 0 19K
Other
What Is a Woman? (2022)
Political commentator Matt Walsh explores the changing concepts of sex and gender in the digital...
By Leonard Pokrovski 2023-07-08 20:42:48 0 17K
Airsoft
How to play airsoft
Everyone is welcome. In this article, we'll figure out how to create a new airsoft team and what...
By FWhoop Xelqua 2023-03-26 19:41:17 0 14K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov