Python Module

0
8K

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

Pesquisar
Categorias
Leia Mais
Social Issues
Casino. (1995)
A tale of greed, deception, money, power, and murder occur between two best friends: a mafia...
Por Leonard Pokrovski 2023-02-11 19:54:34 0 19K
Arts
Where Kids and Teens Can Post Art Online for Free
In today’s digital age, young artists have countless opportunities to showcase their...
Por Dacey Rankins 2024-10-15 17:28:16 0 14K
Life Issues
Penguin Bloom 2021
Based on the best-selling book of the same name, the film tells the story of Sam Bloom (Academy...
Por Leonard Pokrovski 2022-09-17 19:22:26 0 24K
Vehicles
Exploring the Future of Shopping: Mobile Retail on Wheels
Exploring the Future of Shopping: Mobile Retail on Wheels Introduction: In an era where...
Por Leonard Pokrovski 2024-06-05 00:47:01 0 20K
Business
What daily habits do successful founders have?
Success in the startup world rarely happens by accident. Behind every thriving founder is a set...
Por Dacey Rankins 2025-04-14 13:37:20 0 3K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov