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
How Can Emotional Intelligence Aid in Conflict Resolution?
In any setting—whether in the workplace, among friends, or within families—conflict...
By Dacey Rankins 2025-06-05 14:13:35 0 20K
Economics
What Skills Are Needed for Development Economists?
What Skills Are Needed for Development Economists? Development economics is a field dedicated to...
By Leonard Pokrovski 2026-03-17 02:50:12 0 4K
Business
How Do Online Memberships Work? The Business Model Built on Ongoing Value
At first glance, online memberships seem deceptively simple. A person joins. A payment is...
By Dacey Rankins 2026-06-23 21:41:57 0 797
Agriculture
Three types of Rocks
The 3 Different Names Of Rocks With Examples  Whether you’re an avid rockhound or...
By FWhoop Xelqua 2023-05-13 21:08:36 0 28K
Productivity
How does the GTD (Getting Things Done) method work?
How Does the GTD (Getting Things Done) Method Work? In a world full of responsibilities,...
By Michael Pokrovski 2026-03-15 21:04:16 0 4K

BigMoney.VIP Powered by Hosting Pokrov