Andre P.S Duarte wrote:
> How do I define a function, then import it, without having to save it
> in lib; like "C:\python25\lib". ?
>
The best way I have found (in windows ) for permanently extending your
search path for modules is to create the file:
package.pth
and put your path/s in a line
On Apr 5, 12:38 pm, "Andre P.S Duarte" <[EMAIL PROTECTED]>
wrote:
> How do I define a function, then import it, without having to save it
> in lib; like "C:\python25\lib". ?
...or permanently set your PYTHONPATH environment variable to the
folders you want python to look in for the modules you imp
On Apr 5, 1:38 pm, "Andre P.S Duarte" <[EMAIL PROTECTED]>
wrote:
> How do I define a function, then import it, without having to save it
> in lib; like "C:\python25\lib". ?
Defining a function:
def someFunc():
# do something here
Save the file some place. Import the sys module BEFORE you imp
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.
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
myfilefullofusefulfuncti