fmII
Fri, May 16th home | browse | articles | contact | chat | submit | faq | newsletter | about | stats | scoop 11:18 PDT
in
Section
login «
register «
recover password «
[Article] add comment [Article]

 Python Projects
 by Ryan Kulla, in Editorials - Sat, Nov 17th 2001 00:00 PDT

As I write this, there are almost 3,000 projects in freshmeat's C category and almost 1,500 in the Perl category, but there are only about 400 projects in the Python category. SourceForge has similar statistics. In this article, I hope to get more people to consider using Python in their next projects.


Copyright notice: All reader-contributed material on freshmeat.net is the property and responsibility of its author; for reprint rights, please contact the author directly.

My first programming languages were C and Perl. I found C very fast and powerful, but I had constant battles with ever finishing the projects I started in it. I mainly used Perl for one-liners and throw-away scripts. I found that the C programs I wrote contained many lines of code for even the most trivial programs and the Perl programs contained very few lines of code but, due to Perl's cryptic nature, were so hard to read that it didn't really matter.

When I found what Python had to offer, I was amazed. I could write big applications very quickly, and the source code was always easy to read because of how Python is built. Best of all, Python is so easy to learn that you can literally learn it in a weekend just from reading the online tutorial. No expensive books are needed, though there are Python books out there.

There is a lot more to Python than what I can cover in this article, but I am going to show you a few Open Source projects that people have developed using Python, to give you a good idea of just what can be done with it.

If you want to write programs with a Graphical User Interface, there are a few options. Tkinter has been the standard for a while, but you'll probably enjoy either the PyGTK or wxPython toolkit more. Ivo van der Wijk is developing an IRC client in python-gtk called MoST. I have also written a somewhat-functional IRC client called Reptidle in my spare time using wxPython. PyQT is another toolkit to check out.

If you're interested in writing games, Pete Shinners's Pygame library is for you. Pygame, which wraps the SDL library, allows you to create fully-featured games in Python very easily. Pete has also written a couple of games using his library, including the addictive "SolarWolf", which is a remake of the old Atari 2600 game "SolarFox", and "Aliens", which is a demo game that comes bundled with Pygame and is great for learning to write descent games. Jan Ekholm and Gareth Noyce have been working on a Pygame-based realtime network strategy game called Civil for a couple of years now. Pygame also has interoperability with PyOpenGL, a cross-platform Python binding to OpenGL. The creator of Pygame, myself, and some other Pygame fanatics can be found on irc.openprojects.net in #pygame. Come on by anytime.

Games aren't the only thing Pygame is good for, though. There are also some multimedia applications being developed with it. The following are just a few of them:

  • Frank Raiser's PyFile, a graphical file browser.
  • David Clark's PyPanda, an application that streams webcam images from the San Diego Zoo Panda Cam.
  • imgv, a unique image viewer that I wrote (another shameless plug).

For you Web developers, there's a popular Open Source Application Server called "Zope". Zope allows you to create dynamic Web sites in a very object-oriented way. With Zope, everything is editable through the Web. It comes with its own Web server, and you can write Python scripts for it. Zope itself is mostly written in Python. The Zope Book is freely available online, and there is an IRC channel called #zope on irc.openprojects.net.

Twisted by Twisted Matrix Laboratories provides an Open Source framework for developing network applications in Python. Twisted takes a lot of the hassle out of development so you can focus on the good stuff. Currently, it has support for the FTP, HTTP, SMTP, IRC, telnet, POP3, AOL's instant messaging TOC, DNS, LDAP, finger, Echo, discard, chargen, and Perspective Broker protocols. It is constantly being developed by the guys of #python on irc.openprojects.net, so drop in if you have any questions.

Hopefully, after looking at some of the Python projects I've mentioned, you can see that Python is a powerful language that is suitable for real world applications. You can also extend and/or embed C/C++ with Python if you need more speed.


Author's bio:

Ryan Kulla is a freelance writer who specializes in technical writing. He also develops Open Source Software in his spare time. His personal Web site is http://rtfm.insomnia.org/~gt3/.


T-Shirts and Fame!

We're eager to find people interested in writing articles on software-related topics. We're flexible on length, style, and topic, so long as you know what you're talking about and back up your opinions with facts. Anyone who writes an article gets a t-shirt from ThinkGeek in addition to 15 minutes of fame. If you think you'd like to try your hand at it, let jeff.covey@freshmeat.net know what you'd like to write about.

[Comments are disabled]

 Referenced categories

Programming Language :: Python

 Referenced projects

Boa Constructor - A RAD GUI-building IDE for wxPython.
Civil - An turnbased, networked, cross-platform American Civil War game.
imgv - A cross-platform feature rich image viewer.
PyFile - A graphical file browser.
pygame - A Python game development package, based on SDL.
PyGTK - A set of Python bindings for the GTK widget set.
PyOpenGL - A cross-platform Python binding to OpenGL.
Python - A high-level scripting language.
Simple DirectMedia Layer - A library that gives portable low-level access for multimedia applications.
SolarWolf - An action/arcade game written in Python and Pygame
Tkinter - Python's de facto standard GUI package.
Twisted - An event-based networking framework for Internet applications.
wxPython - A Python extension module for wxWidgets.
Zope - A Web application platform for dynamic Web sites.

 Comments

[»] Don't Forget Jython
by arschlesinger - Feb 15th 2003 13:53:15

I find Java much easier to use than C and C++ and the object system is most definitely better than the procedural systems of C, and the object system of C++.

I think that Java is, however, a harder language to learn than Python, but it is faster. Why not use Python inside of Java with Jython? I installed Jython today, and haven't started using it yet, but I see the benefits to it already. A Python script can exist in another file inside of a JAR and can perform some very complicated network operations or get some OS information easily and then give that information easily to a Java object. The only reason to do this is because in some instances, Python is easier to use than Java, but in some cases, Java is better to use than Python, such as GUI programming.

Also, apps can be created very easily with robust plugin architectures, and users could write plugins with either Python or Java.

Python is becoming the next glue language, and it is 100X easier to use and read than Perl.

[reply] [top]


[»] Mixed opinions...
by Denny - Dec 31st 2001 07:15:56

I had to use Python for a project at my last job, and I was left with a severe antipathy toward it... however, as my distance from that unpleasant experience increases, I'm more inclined to think that this is entirely the fault of the GUI toolkit that work made me use, wxPython, rather than anything explicitly wrong with Python itself.

I did deeply resent the enforced layout, but it would be a simple enough thing to adapt to if you put your mind to it... and the OO structure to everything does make development a very pleasant process.

On the whole, I'm a confirmed Perl fan and I'm sure I'll remain so for some time yet... but if I had to use Python again, I don't think I'd be too upset - just as long as I didn't have to use wxPython, which was nasty nasty nasty (IMHO).

Regards,
Denny

--
I really must get a life... as soon as they sell them online, I guess.

[reply] [top]


    [»] Re: Mixed opinions...
    by STANLEY - Apr 5th 2006 07:40:23

    please can u just teah me on how to start with these python programming.i will appreciate if u do it for me

    --
    please i want to use this as a way of learning how to harck,not just to harck but a proffessional one.i will want to meet a friend how can help me in achieving this goal

    [reply] [top]


[»] It's important to note that Python isn't really only one language.
by idfx - Dec 10th 2001 22:10:00

I've been messing with Python for about 2 years, now, and I've come to greatly appreciate it. It can be infinitely easier to read than C,C++, or especially Perl. It's very impressive how its object-oriented nature is thorough, but not intrusive. If you don't want OOP, just ignore the objects.

The indentation is often controversial, but I find that it forces me to write better code in the long run. And I can't imagine how indentation that not only follows the program logic but also defines it can be a worse thing than spending hours looking for a single missing ' ; '.

( BTW, the indentation makes for excellent code 'folding' if your editor supports it. I'm not sure, but I think emacs does. )

But the strongest point of Python, I think, is it's ability to encapsulate other languages, to 'glue' heterogenous code together.

Some resources the author didn't mention are SWIG and SIP, both of which auto- magically generate Python objects from C++ or C code. Also worthy of note is the cousin project Jython, which implements Python in pure Java, and through which the programmer can access both Python and Java objects.

But it's important to note that being involved with Python has different levels. I, for example, am a Python coder, not a developer. I write code in Python, using the excellent tools that some brave coder has already built for me. Usually they did that building in C. I know some C, but not nearly enough to do the kind of things I can do in Python, using only the built-in libraries.

My hat's off to those who give us such tools, but the point I feel is important to note is that it's not all-or-nothing. There are those who write Python, and there are those who write _in_ Python, and you can be whichever you like. You don't have to go any deeper than you want, but you can use it to get a lot done quickly, without abandoning your language of choice. Now that's a power tool.

yrs,

idfx

[reply] [top]


[»] Consider Ruby as well
by r.fan - Nov 21st 2001 01:36:43

Python has it's good points, but some people (especially if you're coming from the Perl world) find Ruby easier to grok.

*Ruby is fully object oriented from the ground up (but it doesn't get in your way like it does with Java).

*Ruby is a very dynamic language: methods can be added to objects or classes at runtime, for example.

*Ruby has true closures (AFIK Python does not, maybe in 2.2)

*Ruby's iterators and blocks are quite handy

*Ruby is a single-inheritance OO language, but it has mixins which allow different behaviours to be included in classes and mixins are also conducive to generic programming.

*Performance-wise, Ruby tends to be a bit slower than Perl and a bit faster than Python

*dRuby is an easy-to-use distributed object system that comes with Ruby (much easier to use than SOAP or XML-RPC and the like)

Check it out:
http://www.ruby-lang.org
http://www.rubygarden.com

[reply] [top]


    [»] Re: Consider Ruby as well
    by Jakub Travnik - Nov 23rd 2001 04:22:26

    Yes, and nice textmode user interface, see JTTui- textmode user interface.
    Does python have something similar? ;-)

    [reply] [top]


      [»] Re: Consider Ruby as well
      by Vsevolod Sipakov - Jun 15th 2003 10:14:35


      > Yes, and nice textmode user interface,
      > see JTTui- textmode user interface.
      > Does python have something similar?
      > ;-)
      >
      Python has curses module.

      [reply] [top]


    [»] Re: Consider Ruby as well
    by Juanjo A. Martínez - Feb 11th 2002 00:45:28


    > *Ruby is fully object oriented from
    > the ground up (but it doesn't get in
    > your way like it does with Java).

    Python (2.2) is also fully object oriented.


    > *Ruby is a very dynamic language:
    > methods can be added to objects or
    > classes at runtime, for example.

    With Python too.


    > *Ruby has true closures (AFIK Python
    > does not, maybe in 2.2)
    True, not even in 2.2


    > *Ruby's iterators and blocks are quite
    > handy

    Python also have iterators (again, 2.2).


    > *Performance-wise, Ruby tends to be a
    > bit slower than Perl and a bit faster
    > than Python

    Absolutely false. Check this out:

    http://www.bagley.org/~doug/shootout/

    [reply] [top]


[»] C, Perl and Python
by Slicer - Nov 20th 2001 18:22:37

I favor your idea of getting more Python out there. To be honest, I haven't coded in this language yet, however I hope to learn soon.
I have to question your reasoning, however. I think diversity and the power of different languages are great. However, if you're having time reading your own code (ex. Perl) then perhaps you need to change your writting style.

However, that aside, I fully support the idea of new Python projects. It'll give me an excuse to learn a new language. :)

[reply] [top]


[»] Don't forget getmail :)
by Charles Cazabon - Nov 20th 2001 17:15:25

(Plug) getmail and queue-repair are also in Python. Development was much quicker than it would have been in C or Perl.

[reply] [top]


[»] PyGTK tutorials
by Thomas Leonard - Nov 20th 2001 10:46:20

I'm now using python for projects whenever I can. When it comes to distributing software you can skip the whole issue of compiler problems (and the need for the user to have gcc and all the needed headers), etc.

Anyway, might as well just plug my PyGTK tutorials here, plus a number of programs, many written using python.

[reply] [top]


[»] Civil...
by TheCorruptor - Nov 19th 2001 05:02:11

...is great. Go check it out, get involved, learn the joys of Python/Pygame, meet interesting and exciting people and become slightly famous...

[reply] [top]


[»] Zope isn't all there is!
by Ian Bicking - Nov 19th 2001 00:45:34

Sometimes Zope is so hyped as the Python Killer App that people don't realize that it is by no means the only way to do web development in Python. Webware and Skunkweb are both application servers using Python, neither of which are nearly as heavy as Zope. They also let you use real Python, without the funny semantics of Zope (e.g., Aquisition).

If your really love Python, I think you'll like those frameworks/application servers much more than Zope -- IMHO they are closer to the design principles behind Python, i.e., transparent and explicit. Python fits in my brain, but Zope most certainly does not.

[reply] [top]


[»] languages aren't an end in themselves
by Mike - Nov 17th 2001 20:42:47

People will write Python software if they have a need for it and if Python seems to be the right tool for it. That's the same for any tool or language.

[reply] [top]


    [»] Re: languages aren't an end in themselves
    by John Munsch - Nov 19th 2001 17:36:04


    > People will write Python software if
    > they have a need for it and if Python
    > seems to be the right tool for it.
    > That's the same for any tool or
    > language.

    While you are quite correct that no language is an end unto itself, there are clear advantages to be had by using certain languages and their use should be encouraged for projects. I would like to encourage anyone considering an open source project to pick a language like Java, Python or Perl over C or C++ so that I don't have to port the resulting application to my platform when I want to run it.

    Many open source projects rumble blindly along assuming that all the world runs Windows, or Linux, or whatever because that is what the author him/herself runs. They then produce something that I either have to port (which I have no time for) or never use if I don't have the same operating system preference as the author.

    At it's best, some languages like Java and Python can offer portable byte code that can run without change on other platforms. I recently received a message from a user saying that my HotSheet project ran perfectly for him on Mac OS X 10.1 even though I've never tried it in that environment myself. The first time I ever tried my application on Linux it worked perfectly without any changes or any recompilation. That kind of portability should be a goal to be strived for by every open source project and it all starts with choosing a language that encourages portability.

    [reply] [top]


[»] quality vs. quantity.
by rainy - Nov 17th 2001 19:17:35

One of the design goals of python was to make code more readable. I think python is very successful in this regard, so it's easier to take existing code and change it rather than start a new project. This could be one of the reasons why there's less python projects around. I myself wrote a few apps: a learning mp3 player, project gutenberg reader, diary program, python shell, burning frontend, vim "random tip" script, and a time management app.. I keep them at silmarill.org/projects/ . Python is neat as hell and I like it much better than any other lang I tried (smalltalk, java, c, c++, perl, ruby). My favorite features are meaningful indentation and clean/minimalistic design.

[reply] [top]


[»] Indentation sux
by Paul Houle - Nov 17th 2001 19:16:54

I was enthusiastic about Python for a little while after it came out. Then I lost about two days work tracing down bugs after a text editor accident messed up the indentation of source files -- it was particularly confusing because there were combinations of spaces and tabs that looked identitical on the screen but looked different to Python.

I realized then and there that stupidity like that would cause me to lose any gains I got from programming in Python and that was the end of my Python career.

Python's a nice language in a number of other ways. In terms of actual features, Python and Perl are competitive, since they're based on similar technology. Each of them has, in some respects, an unorthodox syntax... Except for indentation, Python is a pretty conventional looking OO-language with facile operators for working with composite types. Perl's OO is less rigorous, but it's syntax is practical and powerful otherwise, if unorthodox.

[reply] [top]


    [»] Re: Indentation sux
    by Juanjo A. Martínez - Nov 17th 2001 19:43:19

    Come back to Python, versions > 2.0 give you an 'indentation error' on those cases.

    [reply] [top]


    [»] Re: Indentation sux
    by Mike - Nov 17th 2001 20:41:34


    > I was enthusiastic about Python for a
    > little while after it came out. Then I
    > lost about two days work tracing down
    > bugs after a text editor accident messed
    > up the indentation of source files -- it
    > was particularly confusing because there
    > were combinations of spaces and tabs
    > that looked identitical on the screen
    > but looked different to Python.

    Well, then your text editor was misconfigured. If you
    change the hard tab width (as many Windows editors
    do), you will cause yourself lots of problems, not just
    with Python.

    The simple solution is to remove tabs from your source
    code altogether and use spaces consistently.

    [reply] [top]


    [»] Re: Indentation sux
    by Leon Brooks - Nov 17th 2001 21:53:05


    > I was enthusiastic about Python for a
    > little while after it came out. Then I
    > lost about two days work tracing down
    > bugs after a text editor accident messed
    > up the indentation of source files -- it
    > was particularly confusing because there
    > were combinations of spaces and tabs
    > that looked identitical on the screen
    > but looked different to Python.

    Python 2 and beyond will get suspicious and warn
    you about this, but I agree that this kind of thing is
    annoying. Imagine the fooforaw if C required you to
    indent-and-brace in a particular style to get it
    working!

    Ah, well, there's always Ruby. (-:

    [reply] [top]


[»] Python and other scripting languages.
by Basile Starynkevitch - Nov 17th 2001 02:20:07

I greatly prefer Ruby and Ocaml.
Ruby is a fully OO scripting language that is purer than Python.
Ocaml is a great functional programming langage for real programming.
Please notice that Python's garbage collector is very poor. And some people dislike significant indentation like Python's. At last, type inference and powerful compile time analysis is a big plus of Ocaml.

--
Basile STARYNKEVITCH

[reply] [top]


[»] PythonTheater
by Junta - Nov 17th 2001 01:43:21

I took a brief look at Python code and started playing around and wrote an mpeg/avi player in Python. PythonTheater started out as a little toy to see what I could do, but quickly got really good and I released it. Python has a really good syntax, really lends itself to OO programming. Also, it has a fantastic C API for developing glue between C/C++ and Python code, or simply implementing perfomance modules in the midst of python code. I think the best thing that ever happened to GTK was PyGTK, that API is *far* more intuitive and quick to write in than GTK in C or GTK--- in C++, more on the level of Java Swing. If one could settle on a cross-platform Python GUI, Python would be on the level of Java for cross-platform development. Perl is nice and all, but the syntax can get really ugly, especially if multiple coders with different styles work on a single codebase. Also, Perl lends itself more to structured programming than OO programming. In short, I see Python as a good language for general-purpose programming, while Perl works really well in string processing applications (i.e. web form prcessing, log analyzers, etc..). So for most apps, Python, for a lot of CGI work, Perl :)

[reply] [top]


[»] Alternatively
by rikkus - Nov 17th 2001 00:55:10

No flamewar intended, but if you are looking for a new language, I'd suggest you check out Ruby too.

Rik

[reply] [top]


[»] Python is interesting
by Jeffrey Bakker - Nov 17th 2001 00:51:07

The first thought that came to my mind when I first saw Python code was "what a strange language". I studied it for about a day, and pretty much got the gist of it, then tried writing my own scripts.

Having tried a few already, I think every language has its place. The Python syntax is very interesting, also, it's like nothing I've ever seen before it.

I've tried out some PyGtk examples, and I saw just how powerful Python can be, and It looks promising.

I'd say more good stuff, but I'm not exactly a Python programmer (but I could be).

Oh yeah...and the OO part of Python is very simple to implement. ;)

[reply] [top]


[»] Not that bad!
by Gerhard Häring - Nov 17th 2001 00:22:29

I'm a great fan of Python myself, but in my opinion, the numbers aren't that bad. Python vs. Perl 1:3 that might be relatively close to the number of programmers, there might even be more than 3 times the number of Perl programmers than there are Python programmers.

Plus, we don't need more Python projects per se, but more *useful* software, preferrably written in Python :-) I really don't need another MP3 cataloging software written in Python ;-)

[reply] [top]


    [»] New projects
    by Leon Brooks - Nov 17th 2001 21:56:03


    > Plus, we don't need more Python
    > projects per se, but more *useful*
    > software, preferrably written in Python
    > :-) I really don't need another MP3
    > cataloging software written in Python ;-)

    Hokay, I'll make an Ogg cataloging program instead,
    and I have some really neat ideas for a text editor to
    deal with the descriptions...

    G,D,R (-:

    [reply] [top]


    [»] Re: Not that bad!
    by Michael T. Babcock - Dec 10th 2001 14:42:53


    > Plus, we don't need more Python
    > projects per se, but more *useful*
    > software, preferrably written in Python
    > :-) I really don't need another MP3
    > cataloging software written in Python

    It would also be nice if people remembered that Python objects can be used very easily -- if you like someone else's wordwrap function (something that just happened to me), just "from EmailProgX use WordWrap" ...

    [reply] [top]


    [»] Re: Not that bad!
    by Julio Oña - Apr 17th 2002 23:45:36


    > I'm a great fan of Python myself, but in
    > my opinion, the numbers aren't that bad.
    > Python vs. Perl 1:3 that might be
    > relatively close to the number of
    > programmers, there might even be more
    > than 3 times the number of Perl
    > programmers than there are Python
    > programmers.
    >
    > Plus, we don't need more Python
    > projects per se, but more *useful*
    > software, preferrably written in Python
    > :-) I really don't need another MP3
    > cataloging software written in Python
    > ;-)

    Hey... in Pyhton the most important things are the
    modules.... Make more modules... Let others make
    their projects....

    --
    Thinman

    [reply] [top]


    [»] Re: Not that bad!
    by jalanb - Dec 12th 2005 05:07:56


    > Plus, we don't need more Python projects

    > per se, but more *useful* software,

    > preferrably written in Python :-) I

    > really don't need another MP3 cataloging

    > software written in Python ;-)

    OK, you don't, but I do. The great thing about OS is that we get the code, and the one thing a person writing an mp3 cataloging program needs (because none of the others is quite what I need) is exactly that: lots of other mp3 cataloging software written in Python.

    OK, so I'm actually writing a different project altogether, not mp3 catloguer at all, but the principle is the same - the chance of any one project being the "last word" is minimal, so we need lots of different takes on each project, so that we can take a bit here, a bit there, and roll our own.

    OS projects are for developers, not lusers.

    --
    Alan http://aivipi.blogspot.com

    [reply] [top]




© Copyright 2007 SourceForge, Inc., All Rights Reserved.
About freshmeat.net •  Privacy Statement •  Terms of Use •  Trademark Guidelines •  Advertise •  Contact Us • 
ThinkGeek •  Slashdot  •  ITMJ •  Linux.com •  NewsForge  •  SourceForge.net  •  Surveys •  Jobs •  PriceGrabber