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
Finance
How Secure Are Fintech Apps and Services?
How Secure Are Fintech Apps and Services? Understanding How Your Data and Transactions Are...
By Leonard Pokrovski 2025-10-13 17:08:15 0 5K
Personal Finance
What Tax Advantages Come with Charitable Donations?
What Tax Advantages Come with Charitable Donations? Itemizing vs. Standard Deduction,...
By Leonard Pokrovski 2025-12-24 18:14:00 0 944
Marketing and Advertising
Is AdSense Free to Use?
One of the most common questions beginners ask is:“Is Google AdSense free to use?”...
By Dacey Rankins 2025-12-26 22:29:56 0 3K
Business
What Are Common Barriers to Effective Communication?
Introduction Communication is essential for understanding, cooperation, learning, and building...
By Dacey Rankins 2025-11-20 15:15:55 0 2K
Science in Society
Science in Society: Bridging Knowledge and Progress
Science is more than just a field of study—it is a cornerstone of modern society, shaping...
By Dacey Rankins 2024-11-15 14:54:33 0 13K

BigMoney.VIP Powered by Hosting Pokrov