#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Somewhere over the Rainbow
    Posts
    128
    Rep Power
    12

    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.?
  2. #2
  3. onCsdfeu
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Canada
    Posts
    100
    Rep Power
    12
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    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.
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    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:

    http://www.python.org/Quotes.html

    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..

    http://www.python-hosting.com

    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

    Have fun,
    Mark

IMN logo majestic logo threadwatch logo seochat tools logo