By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,548 Members | 1,550 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,548 IT Pros & Developers. It's quick & easy.

Defining functions in an implementation file

P: n/a
I am fairly new to python and I want to put alot of my functions in
another python file and import or from it into my script so I can call
the functions. How is this done?

Jul 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
westymatt schrieb:
I am fairly new to python and I want to put alot of my functions in
another python file and import or from it into my script so I can call
the functions. How is this done?

import myfilefullofusefulfunctionsandclasses
Works if you have the file

myfilefullofusefulfunctionsandclasses.py

in your PYTHONPATH somewhere - usually, the current dir and some dirs in
the installation directory.

Diez
Jul 18 '06 #2

P: n/a
westymatt wrote:
I am fairly new to python and I want to put alot of my functions in
another python file and import or from it into my script so I can call
the functions. How is this done?
What you are describing are modules. The Python Tutorial has some
information on this

http://docs.python.org/tut/node8.html
Jul 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.