September 17th, 2003, 10:50 PM
Programming in Python?
Hi. I'm interested to learn Python, but I would like to know what kind of projects I can do, I kno that Python has a very simple and consistent syntax and a large standard library, but how can I package and compile Python code ? how can I make *.exe with Python code? , it is possible to make windows or forms, buttons etc.?
September 17th, 2003, 10:57 PM
As for compiling, you can achieve that by calling your Python interpreter with the '-O' option : it will optimize your script and create a "compiled" script, kinda like Java bytecode I guess.
For executable files, check out py2exe (Google your way to it). I've never tried it myself, but it seems to do a pretty good job.
As for UIs, there are 2 libraries available : Tkinter and wxPython. Tkinter is included with your Python installation while wxPython is a separate install. Some people will argue towards one or the other, but it's more a question of personal taste as to which one's best.
September 18th, 2003, 12:22 AM
There are a LOT more than 2 libraries available. In fact, the best library (from a developer standpoint) hasn't even been mentioned - Gtk+. Combine Python with libglade/glade and you've got some really fast GUI app development.
Making .exe files out of python is pretty impractical, really. When you get right down to it, the person will have to have a python interpreter in order to run it. If that means you bundle the interpreter inside the executable (which is what py2exe does), then so be it. But if you are trying to "compile" python scripts so that they are obfuscated and so that people can't "steal" your code, then give up right now because decompiling them is trivial.
September 18th, 2003, 08:02 AM
Python is a great lang'; it's been used to do almost everything - from commersial GUI applications to Zope, a full fledged application server and other Web Scripting.. if you wana know where it's being used and by who check out the quotes page:
There are loads of GUI toolkits, I've headed really good things about PyQT and it's designer, which lets you make GUI's in a similar way to VB.. I havn't really done too much GUI programming though
For the web Python rocks bigtime though.. there are allot of good toolskits out there that you can use to make ur life easier, Spyce is a very good example! And there are modules for nearly every DB you'd imagin..
And lastly, your app isn't running fast enough? You could us Psyco (a JIT compiler) to speed up your program or even write the slow parts in C/C++
Py2EXE may not be the best way to secure your code but it makes distributing your programs on Windows pretty easy , there are other programs which do the same thing but I really havn't heard that much about them. PyEXE seems to be the fav' for this
Conclision Python rocks for everything you may want to use it for.. welcome to the world of Python programming G