Python Module

0
12K

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

Cerca
Categorie
Leggi tutto
Personal Finance
How Do I Apply for Student Loans?
How Do I Apply for Student Loans? A Complete Guide to FAFSA, Deadlines, and Eligibility Paying...
By Leonard Pokrovski 2025-12-15 18:39:59 0 1K
Science Fiction and Fantasy
The Terminator. (1984)
A human soldier is sent from 2029 to 1984 to stop an almost indestructible cyborg killing...
By Leonard Pokrovski 2023-04-28 19:18:14 0 28K
Ask an Expert
Questions for Experts
What questions can be posed to the expert?Over the years of our company's work, we have known...
By FWhoop Xelqua 2023-01-10 15:38:39 0 21K
Научная фантастика и фэнтези
ВАЛЛ-И. WALL·E (2008)
Робот ВАЛЛ·И из года в год прилежно трудится на опустевшей Земле, очищая нашу планету от...
By Nikolai Pokryshkin 2022-12-14 10:18:15 0 35K
Business
How Can I Prevent Social Loafing in Team Projects?
Social loafing—a phenomenon where individuals contribute less effort when working in a...
By Dacey Rankins 2025-05-20 14:45:50 0 8K

BigMoney.VIP Powered by Hosting Pokrov