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 Do I Come Up with a Startup Idea?
One of the most critical steps in launching a successful business is coming up with a compelling...
By Dacey Rankins 2025-04-07 17:29:29 0 8K
Personal Finance
Personal Finance Basics: What You Should Know About Income, Saving, Debt, and Investing
Personal Finance Basics: What You Should Know About Income, Saving, Debt, and Investing Personal...
By Leonard Pokrovski 2025-11-19 22:02:04 0 2K
Marketing and Advertising
Advanced YouTube and Digital Marketing Integration: Long-Term Growth and Brand Mastery
1. YouTube as a Strategic Asset, Not a Tool YouTube should never be treated as just another...
By Dacey Rankins 2025-11-13 17:13:48 0 12K
Marketing and Advertising
How to Measure the Effectiveness of Your Copywriting Efforts
Introduction: Why Measuring Copywriting Matters Copywriting is often described as the “art...
By Dacey Rankins 2025-10-01 14:40:54 0 4K
Science Fiction and Fantasy
Avengers: Endgame. (2019)
After the devastating events of Avengers: Infinity War (2018), the universe is in ruins. With the...
By Leonard Pokrovski 2023-01-03 21:03:41 0 28K

BigMoney.VIP Powered by Hosting Pokrov