Python Module

0
13K

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
Business
How to improve office productivity?
There was a week—just one, though it felt longer—when the office hummed with...
By Dacey Rankins 2026-04-30 17:16:50 0 5K
Life Issues
The Truman Show. (1998)
An insurance salesman discovers his whole life is actually a reality TV show. My Link
By Leonard Pokrovski 2023-02-12 17:03:11 0 24K
Human Resources
What is Total Rewards in HR?
In today’s competitive job market, organizations must go beyond offering just salaries to...
By Dacey Rankins 2026-03-23 13:57:43 0 2K
Economics
What percentage of wealth does the top 1% own?
What Percentage of Wealth Does the Top 1% Own? Wealth inequality has become one of the defining...
By Leonard Pokrovski 2026-07-07 01:00:33 0 670
Decision Making and Problem Solving
Why do people lose money in the stock market?
Why Do People Lose Money in the Stock Market? The Gap Between Expectation and Reality Many...
By Michael Pokrovski 2026-06-09 06:23:07 0 2K

BigMoney.VIP Powered by Hosting Pokrov