Python Module

0
13KB

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 Are Two-Sided Marketplaces?
A restaurant with no customers is not much of a business. A shopping mall with no stores is not...
Por Dacey Rankins 2026-06-17 13:55:32 0 1KB
Horror
The Thing. (1982)
A research team in Antarctica is hunted by a shape-shifting alien that assumes the appearance of...
Por Leonard Pokrovski 2023-02-27 16:32:44 0 27KB
Marketing and Advertising
Who Is Our Target Audience? How Do I Define Buyer Personas?
Introduction One of the most fundamental questions in marketing is: Who are we trying to reach?...
Por Dacey Rankins 2025-10-15 19:04:50 0 7KB
Economics
What are examples of free enterprise?
What Are Examples of Free Enterprise? Walk down any busy street in America and you'll see free...
Por Leonard Pokrovski 2026-06-03 01:11:26 0 4KB
Business
What is Company Culture?
Company culture encompasses the shared values, beliefs, attitudes, actions, and practices that...
Por Dacey Rankins 2025-06-10 15:22:52 0 10KB

BigMoney.VIP Powered by Hosting Pokrov