background preloader

Python

Facebook Twitter

Online Python Tutor - Learn programming by visualizing code execution. Interactive Shell. Python - Notes. You have seen how you can reuse code in your program by defining functions once.

Python - Notes

What if you wanted to reuse a number of functions in other programs that you write? As you might have guessed, the answer is modules. There are various methods of writing modules, but the simplest way is to create a file with a .py extension that contains functions and variables. Another method is to write the modules in the native language in which the Python interpreter itself was written.