Can you tell me how Python modules work?
Python is one of the major object oriented programming languages. One of the benefits of object oriented code is that it is reusable.
I knew that much.
You can write object oriented code as a module, such as generating graphs, performing calculations or the website template. Python, like other object oriented languages, uses code modules for that.
How do they work, though?
Python has libraries of code modules just like Java.
Except better.
You can import Python modules into your program using the import function, Pythonpath.
That sounds a lot like psycho-path.
It is a lot saner than it sounds. Pythonpath is very similar to locating files via the Windows directory structure, except you are calling code modules instead of finding a family photo you uploaded.
What happens once you identify the Python module?
The Python module is added to the list to be run by the Python interpreter. You can even run whole Python projects, called Python eggs.
Does the interpreter compile the eggs separate from the other code modules? Or are the Python eggs already compiled?
Python does not compile, it only interprets. It will interpret each module as it runs every time it runs.
That slows things down.
Compared to running compiled C++ code, sure. Compared to compiling C++ code and waiting for it to finish compiling before you can look for errors, no.
Importing a bunch of code modules together to create a program is certainly better than trying to write the code myself.
You can update individual code modules or even update a Python egg, AKA project, by importing the latest and greatest version.
So that's how Python modules work, plug and play programming.
It's a little harder than plug and play, but you'll definitely save time later by not having to write as much code and needing less time for debugging.
In questa pagina del sito puoi guardare il video online How Python Modules Work della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Techy Help 20 luglio 2014, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,761 volte e gli è piaciuto like spettatori. Buona visione!