Python Module

0
6K

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
Alternative Medicine
Integrative and Other Medicine: Are We in a Trap?
Integrative and Other Medicine: Are We in a Trap? The situation is somewhat strange, to put it...
By Leonard Pokrovski 2024-04-10 21:46:43 0 9K
Nature and Science
The Lion King. (1994)
A young lion prince is cast out of his pride by his cruel uncle, who claims he killed his father....
By Leonard Pokrovski 2022-11-28 21:25:28 0 15K
Социальные проблемы
Капернаум. Capernaum. (2018)
12-летний Зейн не может точно ответить на вопрос, сколько у него братьев и сестер, но уверен, что...
By Nikolai Pokryshkin 2023-01-09 11:36:18 0 20K
Animation
Computer Animation
Computer animation is the process used for digitally generating animated images. The more general...
By FWhoop Xelqua 2022-09-17 19:59:14 0 28K
Middle East
Agriculture and industry in the Middle East
Agriculture and industry in the Middle EastFrom the characteristics of the climate and relief, it...
By FWhoop Xelqua 2023-03-18 18:51:45 0 19K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov