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
Prepare Thoughtful Questions: Show Interest and Initiative in Interviews
One of the most overlooked opportunities in a job interview comes at the end when the interviewer...
By Dacey Rankins 2025-06-20 17:07:48 0 10K
Human Resources
Why Do Companies Offshore Jobs?
In an increasingly interconnected and competitive global economy, businesses are constantly...
By Dacey Rankins 2026-03-30 17:15:11 0 1K
Finance
Who Can Use Fintech – Is It Accessible to Everyone?
Who Can Use Fintech – Is It Accessible to Everyone? Financial technology, or fintech, has...
By Leonard Pokrovski 2025-10-13 17:06:57 0 5K
Programming
JavaScript Map
Map objects are collections of key-value pairs. A key in the Map may only...
By Jesse Thomas 2023-05-19 20:41:47 0 13K
Customer Service
How Is Customer Experience Measured?
Customer Experience (CX) plays a crucial role in determining whether customers remain loyal,...
By Dacey Rankins 2026-03-06 17:18:12 0 3K

BigMoney.VIP Powered by Hosting Pokrov