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

Site içinde arama yapın
Kategoriler
Read More
Do-It-Yourself
How to make a DIY aquarium
How to make a DIY aquarium Nowadays, building a DIY aquarium at home is a fairly simple task...
By Leonard Pokrovski 2024-04-25 10:12:21 0 16K
Horror
The Sixth Sense. (1999)
A frightened, withdrawn Philadelphia boy who communicates with spirits seeks the help of a...
By Leonard Pokrovski 2023-02-15 11:47:16 0 22K
Business
Why Do I Want to Start a Business?
Starting a business is a big decision—one that involves time, effort, and often a...
By Dacey Rankins 2025-02-05 15:53:48 0 10K
Business
When Should You Hire a Lawyer or Advisor in the M&A Process?
Mergers and acquisitions (M&A) are complex, high-stakes transactions that involve financial,...
By Dacey Rankins 2025-11-27 17:24:38 0 667
Business
What are marketing communications?
Marketing communications, like any other communications, consist of certain elements, these are:...
By Dacey Rankins 2024-09-03 19:04:06 0 14K

BigMoney.VIP Powered by Hosting Pokrov