Python Module

0
8K

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

Cerca
Categorie
Leggi tutto
Programming
Python While Loops
While loops can be ran as long as the condition is True. Otherwise, it'll be skipped. A variable...
By Jesse Thomas 2023-03-09 21:24:28 0 7K
Business
What Are the Best Books for Startup Founders?
Starting a business is an exciting yet challenging journey, and as a startup founder, you're...
By Dacey Rankins 2025-04-03 14:54:40 0 3K
Business
What Happens If I Don't Reach My Funding Goal?
Crowdfunding campaigns have become a popular way to raise money for a wide range of projects,...
By Dacey Rankins 2025-03-28 14:32:06 0 4K
Business
Selling or Closing a Business: A Guide for Entrepreneurs
Whether you're looking to move on to new opportunities or simply want to exit your business,...
By Dacey Rankins 2024-12-17 14:29:16 0 8K
Television
KFSM - 5 News Live TV. Arkansas, USA.
KFSM-TV is the CBS-affiliated television station for the Arkansas River Valley and Northwest...
By Nikolai Pokryshkin 2022-10-25 09:45:43 0 23K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov