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


Groups > comp.lang.python > #28699

Reusable (local) Modules

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <travisgriggs@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.039
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'python': 0.09; 'currently,': 0.09; 'modules.': 0.09; 'subject:Modules': 0.09; 'symlink': 0.09; 'tutorials': 0.15; 'files).': 0.16; 'pythonic': 0.16; 'reusable': 0.16; 'travis': 0.16; 'app': 0.19; 'module': 0.19; 'subject:) ': 0.20; 'written': 0.20; 'assuming': 0.22; 'apps': 0.23; "i've": 0.23; 'seems': 0.23; 'command': 0.24; 'creating': 0.26; 'appreciated.': 0.26; 'possibly': 0.27; 'separate': 0.27; 'module.': 0.27; 'received:209.85.210.46': 0.27; 'received:mail-pz0-f46.google.com': 0.27; '"the': 0.29; "i'm": 0.29; 'attach': 0.30; 'problem.': 0.32; 'could': 0.32; 'curious': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'received:172.16': 0.34; 'same.': 0.35; 'received:209.85': 0.35; 'tool': 0.36; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'charset:us-ascii': 0.36; 'subject: (': 0.36; 'level': 0.37; 'two': 0.37; 'received:209': 0.37; 'some': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'little': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'high': 0.61; 'header:Message-Id:1': 0.62; 'relatively': 0.62; 'love': 0.63; 'more': 0.63; 'making': 0.64; 'our': 0.65; 'serial': 0.66; 'family': 0.68; 'products.': 0.74; 'quickest': 0.84; 'ultimate': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; bh=68B6sT+zYEqhfYIA+/DRTC21OUFybP6E85yw3QOP6QE=; b=P4qV76aGPW7ImOUxyjaENebd6fl90m80iFtFjIcPGegI/jA+ffmNTZI8bD5DK/pPt8 Hukpfu2WcqOrCc+mRvuyl9V9Bw6F4Z+XtKH52HI8QANadUXvGoWqBAzFBJUmF+976OXH I6bnyOc5Mo5t3ezD/dQz0n47aiRzaPdJ+Zq6kMMe43Xd41dnRrs0adC1cvb6TW8SxLwZ 5nMwdkgCmluPwb9NopUUNsYuU1qA2tpHFvLPVZI10OMRonxfWRiLRlNWICZvQDcbcez4 lKANFwFlX8VVT+wpj/GbBtVxs6p2/MezXHdyd0aeP4j2xFYOAqCSRoOGrSYgkch8qy7O fHFA==
From Travis Griggs <travisgriggs@gmail.com>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
Subject Reusable (local) Modules
Date Fri, 7 Sep 2012 10:56:15 -0700
To python-list@python.org
Mime-Version 1.0 (Apple Message framework v1278)
X-Mailer Apple Mail (2.1278)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.362.1347040580.27098.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347040580 news.xs4all.nl 6928 [2001:888:2000:d::a6]:56788
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28699

Show key headers only | 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