Python Module

0
12KB

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

Suche
Kategorien
Mehr lesen
Business
What Is an Earn-Out?
In mergers and acquisitions (M&A), one of the most debated, misunderstood, and strategically...
Von Dacey Rankins 2025-11-27 16:53:11 0 3KB
Financial Services
What factors change supply?
Key points Supply curve shift: Changes in production cost and related factors can...
Von Mark Lorenzo 2023-06-29 19:45:47 0 12KB
Marketing and Advertising
What Is Cross-Device Remarketing? A Complete Guide to Reaching the Same User on Different Devices
Today’s customers rarely use just one device. They browse on smartphones, compare prices...
Von Dacey Rankins 2026-02-12 20:40:02 0 1KB
Small Business
How to Promote Small Businesses: Strategies for Success
Promoting a small business can be a challenge, but with the right strategies, it is possible to...
Von Dacey Rankins 2024-12-05 14:27:47 0 11KB
Marketing and Advertising
What Should a Billboard Say?
A billboard has only a few seconds to communicate its message. Unlike digital ads, billboards...
Von Dacey Rankins 2026-01-14 14:09:16 0 2KB

BigMoney.VIP Powered by Hosting Pokrov