Python Module

0
6KB

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
Nach Verein filtern
Read More
Social Issues
Braveheart. (1995)
Scottish warrior William Wallace leads his countrymen in a rebellion to free his homeland from...
Von Leonard Pokrovski 2023-01-02 17:14:50 1 15KB
Business
Why is Business Strategy Important? Understanding the Role of Strategy in Achieving Business Goals
Business strategy is not just a buzzword; it’s the foundation of any successful business. A...
Von Dacey Rankins 2024-12-23 16:02:49 0 4KB
История
Тропы славы. Paths of Glory. (1957)
Действие киноромана развертывается в 1916 году на Западном фронте. Полковник Дэкс командует...
Von Nikolai Pokryshkin 2022-12-16 12:56:36 0 17KB
Financial Services
Elasticity in areas other than price
Key points Elasticity is a general term, referring to percentage change of one...
Von Mark Lorenzo 2023-07-07 20:37:00 0 7KB
Социальные проблемы
Подозрительные лица. The Usual Suspects. (1995)
Если есть преступление, есть и мотив. Если проводится опознание, то по крайней мере есть один...
Von Nikolai Pokryshkin 2022-12-01 21:43:39 0 17KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov