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
Analysis and Opinion
News and Opinions: Understanding the Divide and Their Impact
In today's media landscape, it's essential to distinguish between news and opinions, as they...
By Dacey Rankins 2024-12-10 14:00:33 0 11K
Finance
What Are Interest Rates?
What Are Interest Rates? Interest rates play a fundamental role in the world of finance and...
By Leonard Pokrovski 2025-10-05 19:30:01 0 4K
Business
How Often Should Product Planning Happen?
Product planning is the strategic process of defining what a company should build, why it...
By Dacey Rankins 2025-08-20 15:47:23 0 6K
Animation
Oshi no Ko: Why you should watch it
Oshi no Ko: What the Hot New Anime is About and Why You Should Watch It“Oshi no Ko”...
By FWhoop Xelqua 2023-05-07 20:06:55 0 26K
Photography
The Art and Science of Photography: Capturing Moments, Telling Stories
Photography is more than just a method for recording visual images; it is an art form, a mode of...
By Dacey Rankins 2024-11-13 15:21:37 0 11K

BigMoney.VIP Powered by Hosting Pokrov