Re: defining functions

2007-04-08 Thread rweth
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

Re: defining functions

2007-04-05 Thread 7stud
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

Re: defining functions

2007-04-05 Thread kyosohma
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

Re: Defining functions in an implementation file

2006-07-18 Thread Yu-Xi Lim
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.

Re: Defining functions in an implementation file

2006-07-18 Thread Diez B. Roggisch
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