Python - can I import my own stuff?
I was wondering if there's a way to include another python file full of functions for my script to use without having to move it into my python modules directory. I'm after a similar effect to PHP's 'include' function.
Any help would be appreciated thanks! |
I've recently started reading a book on Python basics... I'm sure you can import your own code just like you can standard Python modules.
Did a quick Google and came up with the page... http://aspn.activestate.com/ASPN/Pyt...tut/node8.html As long as you add to Python's search path, you should be able to import your own code with... import my_program |
All times are GMT -5. The time now is 04:46 PM. |