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

Căutare
Categorii
Citeste mai mult
Director
In Secret. (2013)
Thérèse grows up with her aunt and cousin. Around 1860 the aunt decides they move...
By Leonard Pokrovski 2023-04-28 19:36:18 0 28K
Marketing and Advertising
How Do I Choose the Right Market Research Method? (A Complete 2025 Guide)
Introduction: The Art of Choosing the Right Market Research Approach Market research is one of...
By Dacey Rankins 2025-10-09 18:30:16 0 4K
Business
What Are Core Elements of CRO?
Conversion Rate Optimization (CRO) is often described as both an art and a science. It’s...
By Dacey Rankins 2025-09-10 13:21:32 0 3K
Mental Health
Dyslexia: Associated conditions
Dyslexia often co-occurs with other learning disorders, but the reasons for this comorbidity have...
By Kelsey Rodriguez 2023-06-16 19:07:03 0 11K
Business
What Is Customer Willingness to Pay?
One of the most critical aspects of pricing strategy is understanding how much customers are...
By Dacey Rankins 2025-09-04 13:20:37 0 5K

BigMoney.VIP Powered by Hosting Pokrov