Python Module

0
13Кб

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

Поиск
Категории
Больше
Business
Should I Get PMP or Other Certification? FDA Advice, Career Transitions, and Education FAQs
For professionals in project-driven roles—especially those working in regulated...
От Dacey Rankins 2025-07-15 16:04:08 0 13Кб
Marketing and Advertising
How Do I Design an Effective Outdoor Ad?
Best Practices, Creative Principles, and Real-World Tips Designing an effective outdoor ad is...
От Dacey Rankins 2026-02-02 18:21:21 0 6Кб
Business
How Do Startup Founders Pay Themselves?
As a startup founder, one of the most crucial aspects of building a business is determining how...
От Dacey Rankins 2025-04-02 16:35:40 0 16Кб
Business
Will Automation Replace Administrative Jobs?
Few questions in today’s workplace carry as much weight—or quiet anxiety—as...
От Dacey Rankins 2026-04-28 16:30:51 0 4Кб
Business
How Can Hiring Stay Legal and Ethical with AI Screening?
Artificial Intelligence (AI) is increasingly used in recruitment to screen resumes, evaluate...
От Dacey Rankins 2025-08-13 20:10:10 0 11Кб

BigMoney.VIP Powered by Hosting Pokrov