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

Pesquisar
Categorias
Leia mais
Business
What Should Be Included in a Business Biography?
A business biography is a professional narrative that showcases a person’s career journey,...
Por Dacey Rankins 2024-12-27 15:58:44 0 16KB
Financial Services
Price Ceilings and Price Floors
Key points Price ceilings prevent a price from rising above a certain level....
Por Mark Lorenzo 2023-01-30 14:40:25 0 14KB
Programming
Proxy Webserver in Python
Socket programming in python is very user friendly as compared to c. The programmer need not...
Por Jesse Thomas 2023-03-13 22:09:22 0 11KB
Business
Why Do I Need a Business Consulting Service?
In today’s competitive and ever-evolving business environment, companies face various...
Por Dacey Rankins 2025-02-10 18:11:31 0 11KB
Life Issues
One Flew Over the Cuckoo's Nest. (1975)
In the Fall of 1963, a Korean War veteran and criminal pleads insanity and is admitted to a...
Por Leonard Pokrovski 2022-11-15 21:26:25 0 25KB

BigMoney.VIP Powered by Hosting Pokrov