#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    21
    Rep Power
    0

    Compiled Python Code


    I have been searching around for a way to compile my python scripts beyon .pyc or .pyo files mainly because my company would like to distribute some applications however those byte code files are EASILY decompiled by using the disutils module and by any other methods... Also above the fact that a lot of it is still readable in a text editor.

    At any rate, I don't want an answer like say it in the EULA or something dumb like that. I'm looking specifically for something to do code obfuscation or compile it to bit code if that is at all possible.

    Thanks
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,626
    Rep Power
    4247
    Is this for a windows platform?? If so, search this forum for "py2exe" and you'll find plenty of discussions.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    21
    Rep Power
    0
    Originally Posted by Scorpions4ever
    Is this for a windows platform?? If so, search this forum for "py2exe" and you'll find plenty of discussions.
    Well I am actually making a bundle for Mac but I believe the scripts for windows are still left in .py/.pyc format someone in the dlls or exe am I correct?
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Py2exe will not work on a Mac as far as i know. Anyway I have a 12" Ibook and after searching a little i havnt found anything that looks like it could do the job.

    However the subject does interest me since it would be nice to be able to make stand alone app's with Python on the Mac.

    Feel free to email/PM/IM me if you would want and we can brain storming it, maybe come up with a solusion.

    Take care,

    Mark.
    programming language development: www.netytan.com Hula

  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    21
    Rep Power
    0
    netytan, look up "bundlebuilder" to bundle your python app for mac. It is a module shipped with your mac (or at least mine) that can bundle your python app to a .app. Ummm, as you know a .app is really a folder so you can get into the content and find your scripts in the Resources folder so it's really hiding your code that much either.

    Here's a start
    http://www.pythonmac.org/wiki/BundleBuilder
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    There is a utility called freeze that comes with the python sources that will allow you to do what you want (to some extent). It will bundle the .pyc files into object files so you can recompile the Python sources and link the .pyc files into the executable. This is more complicated to do than using py2exe but (1) it should work for any platform, and (2) there are no .pyc files, since it is all in the executable. The bytecode would still be visible to someone using a hex viewer, but you could possibly hook into the import mechanism and add some encryption.

    Dave - The Developers' Coach
  12. #7
  13. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Frell, well, i guess that means that there are Python modules spacifically for Mac that arnt documented with the other Python modules, or with the undocumented modules

    http://www.python.org/doc/2.3.4/mac/undocumented-modules.html

    Thats not going to make things easy to get to grips with . Thanks much for the info ill look closly at BundleBuilder,

    Mark.
    Last edited by netytan; August 4th, 2004 at 12:04 AM.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo