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
Marketing and Advertising
How Do I Name My Podcast, Choose Cover Art, and Build Branding?
Introduction: The First Impression Matters When launching a podcast, your name, cover art, and...
By Dacey Rankins 2025-10-22 16:01:17 0 4K
Financial Services
How perfectly competitive firms make output decisions
Key points As a perfectly competitive firm produces a greater quantity of output,...
By Mark Lorenzo 2023-07-19 22:25:39 0 14K
Personal Finance
How Often Should I Check My Credit Report?
How Often Should I Check My Credit Report? Your credit report is one of the most important...
By Leonard Pokrovski 2025-10-27 21:08:13 0 4K
Art History
Art History
Principles of periodization and the structure of the general history of art as a scienceWithin...
By FWhoop Xelqua 2023-06-21 16:17:01 0 32K
Finance
How to Get a Mortgage
How to Get a Mortgage Buying a home is one of the biggest financial decisions most people make...
By Leonard Pokrovski 2025-09-20 17:31:03 0 7K

BigMoney.VIP Powered by Hosting Pokrov