Python Module

0
8K

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 Will I Measure Success?
One of the most crucial aspects of running a business is knowing how to measure success. While...
By Dacey Rankins 2025-02-07 16:24:46 0 9K
Жизненные вопросы
Яблоки. Apples. (2021)
В Афинах разгорается необычная эпидемия, люди внезапно теряют память. Жертвой становится и Арис...
By Nikolai Pokryshkin 2022-09-16 20:31:23 0 22K
Business
Neural networks for business and how to work with them
What are neural networks? Imagine that you need to develop a program that will automatically...
By Dacey Rankins 2024-09-11 12:23:41 0 7K
Business
Which Software and Tools Are Recommended for Editing Videos or Photos?
In the digital age, content creation has become more accessible than ever. Whether you’re a...
By Dacey Rankins 2025-02-19 15:26:56 0 5K
Horror
Top 5 Horror Movies You Need to Watch
Horror movies have a unique ability to evoke fear, suspense, and thrill. From psychological...
By Dacey Rankins 2024-10-08 18:34:58 0 12K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov