seeking the "Hello World" of Packages

B

Bell, Kevin

I'm trying to get an idea of how packages work and I've read about it in
the Py Tutorial and Nutshell, but I'm still craving a concrete example
that I can poke through. Does anyone have a really basic package that
does very little that I could look at?

What I've gathered thus far is that a package is simply a directory, say
C:\MyPackage, that would contain __init__.py which tells Python to be
aware of all the other modules in C:\MyPackage. Am I correct?

C:\MyPackage\
\__init__.py
\justPrintHelloWorld.py
\multiply5By10.py

Would I expect the following behavior?:
50
 
F

faulkner

yep, that's all a package is.
if you have trouble importing, check your PYTHONPATH environment
variable, or sys.path.
 
D

dwhall

Kevin,

I just posted a small package to the python package index. It has one
source file of interest and some unit tests. The remaining files are
either needed for or made by distutils. Should be pretty easy to
follow if you've read the distutils docs. Note that the package you
get does not have the MANIFEST.in file (the tool creates MANIFEST
automatically using info from MANIFEST.in).

http://cheeseshop.python.org/pypi/pycscope/0.2

share and enjoy,

!!Dean
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top