Python Module

0
11K

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
What Critical Questions Help Define Good Business Metrics?
In the era of data-driven decision-making, organizations often find themselves swimming in a sea...
By Dacey Rankins 2025-08-27 15:01:19 0 4K
Weather
Weather
A weather forecast is a scientifically based assumption about the future state of the weather in...
By FWhoop Xelqua 2023-03-24 17:35:47 0 17K
Information Services
Information Services: The Backbone of the Digital Economy
In today’s increasingly connected world, information is one of the most valuable assets for...
By Dacey Rankins 2024-11-12 14:42:15 0 12K
Puzzles
Puzzles
Puzzle (from the English puzzle - "puzzle, puzzle") is a puzzle game in which you want to make a...
By FWhoop Xelqua 2023-02-25 16:04:22 0 18K
Personal Finance
How Do I Budget or Plan for Future Education Costs?
How Do I Budget or Plan for Future Education Costs? Planning for education costs—whether...
By Leonard Pokrovski 2025-10-31 20:31:33 0 4K

BigMoney.VIP Powered by Hosting Pokrov