Python Module

0
9K

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
Sports
The Joy of Shopping for Sports: A Fan's Guide to Gear Galore
The Joy of Shopping for Sports: A Fan's Guide to Gear Galore For sports enthusiasts, stepping...
By Leonard Pokrovski 2024-06-03 21:22:46 0 19K
Business
How Can a Startup Biography Attract Investors?
In the competitive world of startups, grabbing the attention of investors goes beyond having a...
By Dacey Rankins 2025-04-21 18:11:16 0 6K
Satire
Satirical News
Satirical (humorous, humorous, parody) news is completely or partially invented information about...
By FWhoop Xelqua 2023-02-28 19:30:00 0 15K
Programming
JavaScript Built-in Methods
What are built-in methods? A JavaScript method is a property containing...
By Jesse Thomas 2023-05-30 22:07:31 0 9K
Horror
Top 5 Horror Movies You Need to Watch
Horror movies have a unique ability to evoke fear, suspense, and thrill. From psychological...
By Dacey Rankins 2024-10-08 18:34:58 0 13K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov