Python Module

0
12KB

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

Rechercher
Catégories
Lire la suite
Music
Music genres
There are only four musical directions: folk music, sacred music, academic music and popular...
Par FWhoop Xelqua 2023-07-07 17:09:02 0 23KB
Business
How to Automate Payroll Processing?
Payroll processing is one of the most critical functions in any organization. It involves...
Par Dacey Rankins 2026-04-24 19:27:57 0 278
Death Care
The Evolving Landscape of Death Care: Honoring Departed Loved Ones
In the grand tapestry of life, death is an inevitable thread. How we approach the end of life and...
Par Dacey Rankins 2024-05-29 19:10:38 0 21KB
Другое
Дикие истории. Wild Tales. (2014)
Гэбриела Пастернака обижали многие, с кем сводила его жизнь – девушка, учитель музыки,...
Par Nikolai Pokryshkin 2023-04-03 12:12:35 0 47KB
Business
How Does Coaching Differ from Mentoring and Counseling?
Coaching, mentoring, and counseling are all supportive, developmental relationships—but...
Par Dacey Rankins 2025-07-21 05:34:42 0 6KB

BigMoney.VIP Powered by Hosting Pokrov