Python Module

0
11K

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
Programming
Python HTTPConnection
An HTTPConnection instance represents one transaction with an HTTP server. It should be...
By Jesse Thomas 2023-04-07 22:06:33 0 12K
Finance
Global and local trends in the fintech sector
The first half of 2024 turned out to be challenging for the financial technology (fintech) market...
By Dacey Rankins 2024-10-22 17:28:48 0 15K
Internet
7 Ways to Become a Clubhouse Star
Fill out your profile correctly. Before accepting a lesson in rooms or in creating them, it is...
By FWhoop Xelqua 2023-06-03 18:08:24 0 25K
Business
How Do I Find the Right Mentor?
Finding the right mentor can be one of the most rewarding steps in your personal and professional...
By Dacey Rankins 2025-07-18 17:42:34 0 7K
Социальные проблемы
Новые времена. Modern Times. (1936)
«Новые времена» - это эмоциональный, выдержанный в комическом ключе, отклик на...
By Nikolai Pokryshkin 2022-12-06 22:41:12 0 26K

BigMoney.VIP Powered by Hosting Pokrov