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

Search
Categories
Read More
Science Fiction and Fantasy
The Invisible Maniac. (1990)
An invisible scientist escapes from an asylum and teaches high-school physics to nubile teens....
By Leonard Pokrovski 2023-05-13 18:10:28 0 32K
Pre-School
The Importance of Preschool: Laying the Foundation for Lifelong Learning
Preschool is often seen as the first formal experience for young children before they enter...
By Dacey Rankins 2024-11-27 17:49:03 0 12K
Mental Health
Blues, go away: 7 ways to cheer yourself up
The period of transition from one season to another is often accompanied by a depressed mood. How...
By FWhoop Xelqua 2023-03-06 15:41:41 0 19K
Спорт
Малышка на миллион. Million Dollar Baby. (2004)
Тренеру по боксу Фрэнку Данну так и не удалось воспитать чемпиона. Он владеет спортивным залом в...
By Nikolai Pokryshkin 2023-03-16 13:50:53 0 30K
Mental Health
ADHD: Exercise
Regular physical exercise, particularly aerobic exercise, is an effective add-on treatment for...
By Kelsey Rodriguez 2023-05-03 17:41:29 0 11K

BigMoney.VIP Powered by Hosting Pokrov