Python Module

0
12K

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

Cerca
Categorie
Leggi tutto
Business
How long does it take to start earning passive income?
The idea of earning passive income is appealing to many people, as it promises the opportunity to...
By Dacey Rankins 2025-01-16 15:38:59 0 18K
Horror
The Little Things (2021)
Kern County Deputy Sheriff Joe Deacon is sent to Los Angeles for what should have been a quick...
By Leonard Pokrovski 2022-09-24 18:43:08 0 35K
Television
Parliament On Demand, Live TV, New Zealand.
Welcome to Parliament on Demand, the home of Parliament TV and all of New Zealand Parliament's...
By Nikolai Pokryshkin 2022-11-11 19:47:53 0 28K
Business
What Moment Shaped Me Most?
Life is often described as a journey, and along that journey there are moments—sometimes...
By Dacey Rankins 2025-09-09 14:17:09 0 4K
Personal Finance
What Interest Rate Will I Pay? Understanding APR, Fees, and Loan Terms
What Interest Rate Will I Pay? Understanding APR, Fees, and Loan Terms When you take out a loan,...
By Leonard Pokrovski 2025-11-06 19:13:48 0 4K

BigMoney.VIP Powered by Hosting Pokrov