Python Module

0
9K

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

Zoeken
Categorieën
Read More
Социальные проблемы
Жизнь прекрасна. Life Is Beautiful. (1997)
Во время Второй мировой войны из Италии в концлагерь были отправлены евреи - отец с маленьким...
By Nikolai Pokryshkin 2022-11-19 16:37:39 0 28K
Financial Services
8 money tips for freelance workers
If you’ve traded in your cubicle to become a freelancer, you’re not alone. Fifteen...
By Mark Lorenzo 2023-05-18 19:49:49 0 22K
Internet
Google ads: interface and settings
Definition Google Ads is an advertising platform for self-setting advertising campaigns with...
By FWhoop Xelqua 2023-01-30 17:35:11 0 17K
Mental Health
Autism Spectrum: Management
There is no treatment as such for autism, and many sources advise that this is not an appropriate...
By Kelsey Rodriguez 2023-03-13 19:00:17 0 10K
Paranormal
Unveiling the Enigma: Exploring the World of Paranormal Activities
Unveiling the Enigma: Exploring the World of Paranormal Activities Introduction: Paranormal...
By Leonard Pokrovski 2024-06-10 23:00:40 0 16K

BigMoney.VIP Powered by Hosting Pokrov