|
| Thu, Jan 08th | home | browse | articles | contact | chat | submit | faq | newsletter | about | stats | scoop | 03:22 UTC |
|
login « register « recover password « |
| [Article] | add comment | [Article] |
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:
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]
[»]
Don't Forget Jython 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++.
[»]
Mixed opinions... 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,
--
[»]
Re: Mixed opinions... please can u just teah me on how to start with these python programming.i will appreciate if u do it for me --
[»]
It's important to note that Python isn't really only one language. 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
[»]
Consider Ruby as well Python has it's good points, but some people (especially if you're coming
from the Perl world) find Ruby easier to grok.
[»]
Re: Consider Ruby as well Yes, and nice textmode user interface, see JTTui- textmode user
interface.
[»]
Re: Consider Ruby as well
[»]
Re: Consider Ruby as well
[»]
C, Perl and Python 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.
[»]
Don't forget getmail :) (Plug) getmail and queue-repair are also in Python. Development was much quicker than it would have been in C or Perl.
[»]
PyGTK tutorials 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.
[»]
Civil... ...is great. Go check it out, get involved, learn the joys of Python/Pygame, meet interesting and exciting people and become slightly famous...
[»]
Zope isn't all there is! 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.
[»]
languages aren't an end in themselves 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.
[»]
Re: languages aren't an end in themselves
[»]
quality vs. quantity. 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.
[»]
Indentation sux 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.
[»]
Re: Indentation sux Come back to Python, versions > 2.0 give you an 'indentation error' on those cases.
[»]
Re: Indentation sux
[»]
Re: Indentation sux
[»]
Python and other scripting languages. I greatly prefer Ruby and Ocaml. --
[»]
PythonTheater 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 :)
[»]
Alternatively No flamewar intended, but if you are looking for a new language, I'd suggest you check out Ruby too. Rik
[»]
Python is interesting 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.
[»]
Not that bad! 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.
[»]
New projects
[»]
Re: Not that bad!
[»]
Re: Not that bad!
--
[»]
Re: Not that bad!
--
|