FAQ
I have .py file which uses some third party modules like egg files, like
simplejson and python-twitter ,

----- start of file -----

import ConfigParser
import getopt
import os
import sys
import twitter


when i compile this py file using compile module , i get .pyc file . Now my
question is , if i run .pyc file on another computer containing only python
installed , will it run ? or do i need to install 3rd party lib again on
that computer ? Anyone know how to make program lib independent , something
called embedded into one file only ?

thank you in anticipation .

Rohan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090305/83dbcc24/attachment-0001.htm>

Search Discussions

  • Chris Rebert at Mar 4, 2009 at 7:43 pm

    On Wed, Mar 4, 2009 at 11:38 AM, Rohan Hole wrote:
    I have .py file which uses some third party modules like egg files, like
    simplejson and python-twitter ,

    ----- start of file? -----

    import ConfigParser
    import getopt
    import os
    import sys
    import twitter


    when i compile this py file using compile module , i get .pyc file . Now my
    question is , if i run .pyc file on another computer containing only python
    installed , will it run ? No.
    or do i need to install 3rd party lib again on
    that computer ?
    Yes. The .pyc /only/ contains the code for the .py file it was
    generated from; it does /not/ contain the code for any imported
    libraries.
    Anyone know how to make program lib independent , something
    called embedded into one file only ?
    py2exe (http://www.py2exe.org/) is the usual tool for this on Windows.
    It takes a Python program and bundles it together with the Python
    executable and any imported libraries to yield a standalone .exe

    Cheers,
    Chris

    --
    I have a blog:
    http://blog.rebertia.com
  • Shane Geiger at Mar 4, 2009 at 8:18 pm
    py2exe (Windows) and py2app (Mac) are probably what you are looking for.



    Rohan Hole wrote:
    I have .py file which uses some third party modules like egg files,
    like simplejson and python-twitter ,

    ----- start of file -----

    import ConfigParser
    import getopt
    import os
    import sys
    import twitter


    when i compile this py file using compile module , i get .pyc file .
    Now my question is , if i run .pyc file on another computer containing
    only python installed , will it run ? or do i need to install 3rd
    party lib again on that computer ? Anyone know how to make program lib
    independent , something called embedded into one file only ?

    thank you in anticipation .

    Rohan.
    ------------------------------------------------------------------------

    --
    http://mail.python.org/mailman/listinfo/python-list

    --
    Shane Geiger, IT Director
    Council For Economic Education / www.councilforeconed.org
    sgeiger at councilforeconed.org / 402-438-8958

    Teaching Opportunity

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMar 4, '09 at 7:38p
activeMar 4, '09 at 8:18p
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase