What you want to do is take a Python file and use it as a module or library .
It is impossible to make these four functions automatically available, no matter what is 100% percent of the time, but you can do something very close.
For example, at the top of the file, you imported numpy . numpy is a module or library that has been configured in such a way that they are available every time python starts if you import .
You want to do the same - save these 4 functions in a file and import them whenever you want.
For example, if you copy and paste these four functions into a file called foobar.py , you can simply do from foobar import * . However, this will only work if you use Python in the same folder where you saved the code.
If you want your module to be available on the system, you need to save it somewhere on PYTHONPATH . Usually saving it to C:\Python27\Lib\site-packages will work (assuming you are using Windows).
source share