Python Module

0
12K

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

Zoeken
Categorieën
Read More
Television
WKRG News 5 Live Newscast stream TV. USA.
WKRG NEWS 5 LIVE NEWSCAST SCHEDULE:MORNING NEWS: Weekday mornings 4:30 – 7 a.m.MIDDAY...
By Nikolai Pokryshkin 2022-11-24 15:26:42 0 36K
Business
What Resources Are Included in IaaS?
Most business leaders understand the promise of Infrastructure as a Service long before they...
By Dacey Rankins 2026-06-05 03:32:18 0 6K
Programming
Python Force Raise Errors
You can force raise errors for your application in your library/code. These errors can be useful...
By Jesse Thomas 2023-02-20 22:00:40 0 13K
Economics
Is Commerce a Good Career Option?
Is Commerce a Good Career Option? Choosing a career stream is one of the first big decisions...
By Leonard Pokrovski 2026-02-20 22:01:14 0 9K
Productivity
Why do I quit learning new skills?
Why Do I Quit Learning New Skills? Most people do not quit learning because they are lazy. They...
By Michael Pokrovski 2026-05-31 16:39:55 0 826

BigMoney.VIP Powered by Hosting Pokrov