Computer Science Canada

connecting different python files

Author:  shaon [ Tue Mar 11, 2008 7:27 pm ]
Post subject:  connecting different python files

I have a lot of files which have a ton of useful functions and classes that I made over time. I don't want to have to copy and paste them into a new python file every time. Is there a built-in-function which can link files together?

Author:  Nick [ Wed Mar 12, 2008 1:29 am ]
Post subject:  RE:connecting different python files

import [filename without extension]

Author:  McKenzie [ Wed Mar 12, 2008 8:19 am ]
Post subject:  Re: connecting different python files

And it works the same as built-in modules too. If you want to dump your functions into the current namespace use:
code:
from utilities import *

(if utilities.py had your functions in it)


: