Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28699

Reusable (local) Modules

From Travis Griggs <travisgriggs@gmail.com>
Subject Reusable (local) Modules
Date 2012-09-07 10:56 -0700
Newsgroups comp.lang.python
Message-ID <mailman.362.1347040580.27098.python-list@python.org> (permalink)

Show all headers | View raw


I'm relatively new to Python (coming from strong C and Smalltalk backgrounds). I've written a couple of relatively small apps (one or two .py files). I'm using PyCharm (I love it).

I'm curious what the pythonic approach is to creating your own reusable modules. Any tutorials or high level explanations, or detailed, much appreciated. 

For example, I have a small module called valvenumbers.py. It's a family of functions that we use to do a variety of things with the serial numbers we attach to some of our products. Now I'm making a little desktop app using wxpython, and I want to use (import) that module. Using PyCharm, I have two separate projects in sibling directories. And there's another separate command line tool that wants to do the same. Currently, I just place a symlink to the valvenumbers.py, local to the directory of these apps. This seems like "the quickest thing that could possibly work", but I'm assuming there's a more pythonic way to approach this general problem.

TIA!

Travis Griggs
"Simplicity is the ultimate sophistication." -- Leonardo Da Vinci

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Reusable (local) Modules Travis Griggs <travisgriggs@gmail.com> - 2012-09-07 10:56 -0700

csiph-web