Python Module

0
12KB

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

Rechercher
Catégories
Lire la suite
Business
What Metrics Indicate Product Success?
Measuring product success is one of the most critical responsibilities of a product manager (PM)....
Par Dacey Rankins 2025-08-18 13:27:03 0 5KB
Business
What is Crowdfunding?
Crowdfunding is a modern fundraising method that enables individuals, organizations, and...
Par Dacey Rankins 2025-03-27 18:05:50 0 9KB
Business
What Are Your Strengths and Weaknesses? A Window into Self-Awareness and Growth Potential
The interview question “What are your strengths and weaknesses?” remains a classic...
Par Dacey Rankins 2025-06-25 12:42:58 0 11KB
Productivity
How do I measure productivity?
How Do I Measure Productivity? Productivity is often misunderstood as “how busy you...
Par Michael Pokrovski 2026-02-20 22:40:39 0 3KB
Marketing and Advertising
What Is Google AdSense?
Google AdSense is one of the most widely used online monetization platforms in the world....
Par Dacey Rankins 2025-12-24 20:21:15 0 2KB

BigMoney.VIP Powered by Hosting Pokrov