On Fri, Jun 6, 2008 at 10:57 AM, Kyle R. Burton <kyle.burton@...> wrote:
> I'm entirely new to Python at this point. I realize that I can Google
> to find specific items that address or answer my questions below, what
> I'm looking for is feedback based on first hand experiences, lessons
> you've learned etc (which isn't always discernible from the web).
Of course.
> E.g. for Perl, always use strict and warnings, it's worth the effort
> if stability and robustness are important.
> Does anyone have advice or best practices to follow for Python with respect
> to:
>
> - organizing projects, source, etc
> - developing, installing, finding libraries (Perl has CPAN, Java has
> Jars, Ruby has Gems)
Newer Pythons have eggs, but that's unlikely to help you with Jython
at this point. I'm unfamiliar
with Jython, but I assume that you'll be using the "old" system of
installing packages through the
distributed 'setup.py' file.
PyPi (CheeseShop) is the place to go for packages, though again, I'm
guessing that most of the
packages there will be of limited use for Jython.
http://pypi.python.org/pypi/
> - building or running (Perl has Makefile.PL, Ruby has Rake, Java has
> Ant and Maven)
See setup.py, it does bytecompiling and installation.
> - development tools, such as:
>
> - unit testing framework (eg: JUnit)
Batteries included. There are unittesting frameworks included in the
standard Python distribution. I know for certain
that the `doctest` module was included in 2.2
(http://www.python.org/doc/2.2.3/lib/module-doctest.html)
Doctest is interesting, because it actually acts as documention for
how to use the function or class. Python has
doctrings much like common lisp that are accessible through the
__doc__ property. (e.g. foo.__doc__)
Tthere's also `unittest`
(http://www.python.org/doc/2.2.3/lib/module-unittest.html)
> - a coverage analysis tool (eg: Devel::Cover for Perl)
>
> - debugger, profiler, etc
Python comes with a debugger, pdb. Some interesting things about it is
that you can fall into it interactively just by importing the module.
So, when you're testing something in your file, it throws an
exception, bam. import pdb followed by pdb.pm() and you're there.
I haven't looked at all about profilers, as I've never written
anything of critical value that has warranted speed increases.
> - recommended IDE or Editor (I'm an Emacs guy, but many of our devs
> are Eclipse experts) - or modules for existing editors
Emacs22 comes with python-mode.el, which allows interactive
programming through Emacs. I can't recommend any other IDEs, though I
know lots exist. cPython comes with IDLE, which more people than I
thought actually like and use.
> - does Python have an equivalent to Javadoc / POD for embedded
> documentation?
Docstrings and `pydoc` will probably suffice, and should already be
available, though I'm sure there are many others.
--
Andrew Gwozdziewycz
apgwoz@...
http://www.apgwoz.com | http://www.photub.com