Thread: Compiled Python

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

    Join Date
    May 2004
    Posts
    2
    Rep Power
    0

    Cool Compiled Python


    Ok, I know that *.pyc files indicate compiled python files, but that's really all i know. My question is: Are *.pyc files similar tocompiled c++ code, so that you don't need the python interpretor everytime you run it. If so, then does that mean anyone can run *.pyc files even if they don't have the python interpretor?

    All replies appreciated, thanks.
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    The quick answer is no, Python's .pyc files are actually more like Java .class files and contain Bytecode designed for the interpriter to read!

    If you want to have Python programs run without the user havign to install Python you should check out py2exe.

    http://starship.python.net/crew/theller/py2exe/

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

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

    Join Date
    May 2004
    Posts
    2
    Rep Power
    0
    Thanks for the clarification, mark -- and this py2exe tool looks really neat! Do you use it often?
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Actually i've been try to stay away from Windows lattly (I think i've been bitten by that Mac but thats been going around ), which could have something to do with the crap available in cyber cafe's, but i have used it for various projects in the past...

    Though i'd have to admit i've mostly use it to pass a Python programs to a friends without Python - or when i need to take my own hand coded tools with me!

    It's just an all round handy tool to have , and something any Python users shouldn't be without! Even those on *nix or Mac!

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


IMN logo majestic logo threadwatch logo seochat tools logo