Python Module

0
11KB

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
Marketing and Advertising
How Do We Audit Past Marketing Efforts to Inform a Better Strategy?
Introduction A marketing strategy without reflection is like sailing without a compass. Even the...
Por Dacey Rankins 2025-10-16 19:03:01 0 2KB
Business
How to Identify and Qualify New Business Opportunities or Partnerships: A Complete 3,000-Word Guide
Introduction Identifying and qualifying business opportunities is one of the most critical...
Por Dacey Rankins 2025-11-17 18:30:02 0 1KB
Personal Finance
How Often Should I Check My Credit Report?
How Often Should I Check My Credit Report? Your credit report is one of the most important...
Por Leonard Pokrovski 2025-10-27 21:08:13 0 2KB
Regional
Global Innovation Index 2022
According toWIPO's 2022 Global Innovation Index (GII) report, the world's most innovative...
Por FWhoop Xelqua 2022-11-23 14:23:39 0 28KB
Business
How Social PR Works
The values that brands convey affect consumer choices. They like to buy products from socially...
Por Dacey Rankins 2024-09-09 16:47:08 0 12KB

BigMoney.VIP Powered by Hosting Pokrov