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
Business
Which Cloud Model Is Best for Businesses?
Business leaders often ask cloud experts a deceptively simple question. Which cloud model is...
Par Dacey Rankins 2026-06-05 19:30:28 0 1KB
Mental Health
ADHD: SOCIETY
The youngest children in a class have been found to be more likely to be diagnosed as having...
Par Kelsey Rodriguez 2023-04-07 18:27:38 0 13KB
Ethics
Computer Ethics: Navigating the Moral Landscape of Technology
As technology continues to advance at an unprecedented rate, the ethical implications of its...
Par Dacey Rankins 2024-11-13 15:53:33 0 15KB
Телевидение
World Fashion Channel Live TV.
World Fashion Channel – это международный телеканал о современных тенденциях в индустрии...
Par Nikolai Pokryshkin 2022-11-01 08:49:23 0 38KB
Social Issues
The Shawshank Redemption. (1994)
Chronicles the experiences of a formerly successful banker as a prisoner in the gloomy jailhouse...
Par Leonard Pokrovski 2022-10-30 19:43:08 0 31KB

BigMoney.VIP Powered by Hosting Pokrov