Python Module

0
8KB

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

Search
Nach Verein filtern
Read More
Programming
JavaScript has()
The has() function of the map object accepts a key in string format and returns a...
Von Jesse Thomas 2023-05-16 11:21:29 0 7KB
Reproductive Health
What is reproductive health?
What is reproductive health? What is reproductive health? Reproductive...
Von Leonard Pokrovski 2024-04-19 01:00:36 0 13KB
Programming
Python Random
If you ever want to make some random choice or number for something, there's a pre-installed...
Von Jesse Thomas 2023-02-13 21:54:59 0 7KB
Business
How much equity should a founder give to investors?
One of the most important decisions a founder will make when raising capital is determining how...
Von Dacey Rankins 2025-04-08 14:19:54 0 4KB
Business
What is the Difference Between a Business Plan and a Business Model?
This question often comes up as people try to clarify the distinction between two critical...
Von Dacey Rankins 2024-12-18 16:44:40 0 6KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov