Python Module

0
11Кб

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).

Поиск
Категории
Больше
Satire
Top 16 best TV series of 2022
Paradoxically, this terrible war year was very rich in good TV shows. I picked you eight of the...
От FWhoop Xelqua 2023-01-02 17:51:46 0 24Кб
Business
How Is Mentoring Different from Coaching?
Mentoring and coaching are both powerful development tools—but they serve different...
От Dacey Rankins 2025-07-18 17:33:08 0 3Кб
Деньги
How to Improve Credit Score
How to Improve Credit Score A healthy credit score is one of the most important tools for...
От Leonard Pokrovski 2025-09-17 20:51:06 0 2Кб
Healthcare
The Evolution and Importance of Healthcare: Ensuring Well-Being for All
Healthcare is a fundamental pillar of society, crucial not only for individual well-being but...
От Dacey Rankins 2024-11-25 15:22:50 0 11Кб
Business
Profession PR manager (PR manager)
Who is a PR manager?A PR manager or PR manager (from the English public relations) is a...
От Dacey Rankins 2024-09-03 19:09:01 0 15Кб

BigMoney.VIP Powered by Hosting Pokrov