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 Happens When a Story Isn’t Completed in the Sprint?
Agile methodologies like Scrum emphasize delivering working software in short, iterative cycles...
By Dacey Rankins 2025-08-26 11:40:28 0 6K
Business
What is a business model?
A business model is a crucial component of any company, whether it's a startup or an established...
By Dacey Rankins 2025-01-09 15:23:12 0 12K
Internet
How to get popular on twitter
Becoming a popular and influential person or company on Twitter is not as easy as opening an...
By FWhoop Xelqua 2023-06-02 19:54:02 0 23K
Business
How Do I Start a Speech?
Starting a speech is one of the most important parts of public speaking. Your opening sets the...
By Dacey Rankins 2025-12-10 17:43:10 0 999
Performance and Capacity
SSD with DRAM and without DRAM: understanding the differences
SSD with DRAM and without DRAM: understanding the differences Solid-state drives (SSDs) have...
By Leonard Pokrovski 2024-03-28 22:10:50 0 23K

BigMoney.VIP Powered by Hosting Pokrov