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

Search
Categories
Read More
Business
What Are the Next Steps in the Hiring Process?
After completing a job interview, it’s natural to wonder what comes next. Candidates often...
By Dacey Rankins 2025-06-24 15:25:41 0 12K
Business
What Tools or Techniques Support Product Planning?
Product planning is the backbone of effective product management. It provides clarity on what...
By Dacey Rankins 2025-08-20 15:53:01 0 5K
Personal Finance
How Long Does Negative Information Stay on My Credit Report?
How Long Does Negative Information Stay on My Credit Report? Your credit report is one of the...
By Leonard Pokrovski 2025-10-27 21:09:53 0 5K
Business
Where Can I Find Free Business Plan Templates?
When starting a new business or refining an existing one, one of the most essential tools for...
By Dacey Rankins 2024-12-19 14:56:09 0 12K
Mental Health
ADHD: Executive function and motivation
The symptoms of ADHD arise from a deficiency in certain executive functions (e.g., attentional...
By Kelsey Rodriguez 2023-05-02 19:53:02 0 13K

BigMoney.VIP Powered by Hosting Pokrov