How to create ones own lib

H

Horst Jäger

Hi,

I would like to create my own lib "hotte.py" which I can import like


import string,hotte

.. How do I do that?

I'm working on MacOS 10.5.6 .

Thanks in advance
 
F

Francesco Bochicchio

Hi,

I would like to create my own lib "hotte.py" which I can import like

        import string,hotte

. How do I do that?

I'm working on MacOS 10.5.6 .

Thanks in advance

Just create the file 'hotte.py' and place it somewhere python can find
it, that is:
- in the same directory of the code using it (which is most probablyt
what you want to do )
- in a directory listed in sys.path variable (which you can extend
using sys.path.append("full_path_of_my_library_directory") before
doing import hotte

There are other options, but these should cover your needs.

Ciao
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top