Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Anyone have any Ideas? My Problem with Python!

  1. #1
    Join Date
    Oct 2010
    Location
    The Big, Bad, World!
    Beans
    120
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Thumbs down Anyone have any Ideas? My Problem with Python!

    Just to post here, that I love Python and I use it a lot in terms of my programming. I have 1 main problem with Python. There is no option inside of the Compiler to make straight executables, that do not require the end-user to have Python installed. I know in Windows you can use Py2exe and Cx_Freeze in Linux, but they result in massive file sizes, and furthermore I haven't a clue as to how you would go about using Cx_Freeze in the first place.

    Any suggestions...

    x-D
    Choose Freedom, Choose Linux, Choose Ubuntu.

  2. #2
    Join Date
    Dec 2004
    Location
    Manchester
    Beans
    2,086
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: Anyone have any Ideas? My Problem with Python!

    there is an early attempt a using GCC to compile python.
    http://gcc.gnu.org/wiki/PythonFrontEnd

    there is also cython that translates python to c and then compiles it. though it is aimed at making fast libraries that can be called from normal python.

    is the any particular reason you want this? pretty much every linux distro has python installed (and the main ones use python for a lot of basic tasks). If someone has linux without python then they must have some specialist reason, for example very low memory, in which case they probably wont want to run your python app.

  3. #3
    Join Date
    Oct 2010
    Location
    The Big, Bad, World!
    Beans
    120
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Thumbs down Re: Anyone have any Ideas? My Problem with Python!

    Quote Originally Posted by ssam View Post
    there is an early attempt a using GCC to compile python.
    http://gcc.gnu.org/wiki/PythonFrontEnd

    there is also cython that translates python to c and then compiles it. though it is aimed at making fast libraries that can be called from normal python.

    is the any particular reason you want this? pretty much every linux distro has python installed (and the main ones use python for a lot of basic tasks). If someone has linux without python then they must have some specialist reason, for example very low memory, in which case they probably wont want to run your python app.
    I've heard that there are some distros that do not come pre-installed with Python, and I'm thinking about trying to make a Cross-Platform project, using .py for Linux, and then .exe for Windows.

    Thanks for the Reply, really helped.
    Choose Freedom, Choose Linux, Choose Ubuntu.

  4. #4
    Join Date
    Oct 2010
    Location
    The Big, Bad, World!
    Beans
    120
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Thumbs down Re: Anyone have any Ideas? My Problem with Python!

    Quote Originally Posted by ssam View Post
    there is an early attempt a using GCC to compile python.
    http://gcc.gnu.org/wiki/PythonFrontEnd

    there is also cython that translates python to c and then compiles it. though it is aimed at making fast libraries that can be called from normal python.

    is the any particular reason you want this? pretty much every linux distro has python installed (and the main ones use python for a lot of basic tasks). If someone has linux without python then they must have some specialist reason, for example very low memory, in which case they probably wont want to run your python app.
    Another question, inside Windows, using IronPython on the .NET Framework. Does this allow for the creation of standard .exe files, with a smaller filesize than that of say py2exe?

    And does IronPython have the exact same syntax as regular Python?
    Choose Freedom, Choose Linux, Choose Ubuntu.

  5. #5
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: Anyone have any Ideas? My Problem with Python!

    I've heard good things about this:

    http://www.py2exe.org

    Haven't tried it however, as I don't do much in Windows these days.

  6. #6
    Join Date
    Oct 2010
    Location
    The Big, Bad, World!
    Beans
    120
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Thumbs down Re: Anyone have any Ideas? My Problem with Python!

    Quote Originally Posted by billdougan View Post
    I've heard good things about this:

    http://www.py2exe.org

    Haven't tried it however, as I don't do much in Windows these days.
    Yeah, that seems to be the way forward in Windows, but I'm looking for something that 'actually' compiles it, instead of converting it into C or C++ and then adding an interpretor for the modules you've imported, as this is slow and has a very large file size

    x-D
    Choose Freedom, Choose Linux, Choose Ubuntu.

  7. #7
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Anyone have any Ideas? My Problem with Python!

    Quote Originally Posted by x-D View Post
    Just to post here, that I love Python and I use it a lot in terms of my programming. I have 1 main problem with Python. There is no option inside of the Compiler to make straight executables, that do not require the end-user to have Python installed. I know in Windows you can use Py2exe and Cx_Freeze in Linux, but they result in massive file sizes, and furthermore I haven't a clue as to how you would go about using Cx_Freeze in the first place.
    There is no silver bullet. Either the stand-alone code you generate includes the equivalent of the whole interpreter(the best you can dream of is a DLL/SO to avoid duplicating it across your modules) or you can generate executables of reasonable size but you have to forget many of the niceties of the language that come from its dynamic execution (the eval()-type instruction are the first to go, usually). So it all depends on how much of Python you use in your code (but if you don't use much of Python, rewriting in another language shouldn't be difficult).

  8. #8
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Anyone have any Ideas? My Problem with Python!

    Unfortunately, the nature of dynamically typed languages makes compiling them to machine code before run-time very difficult.

    Because Python is not statically typed (the references are untyped, only the objects they point to are) makes it very difficult to know the types at compile time and generate machine code for them. Only at runtime, the types are revealed and the interpreter generates the machine code and runs it.

    What py2exe does, is takes your code, the libraries it uses and embeds the interpreter into the .exe. That should explain the big file sizes.
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

  9. #9
    Join Date
    Dec 2004
    Location
    Manchester
    Beans
    2,086
    Distro
    Ubuntu Mate 15.10 Wily Werewolf

    Re: Anyone have any Ideas? My Problem with Python!

    you might find this series of posts interesting
    http://en.wordpress.com/tag/pythons-innards/

    it shows what actually happens when you run a piece of python code.

  10. #10
    Join Date
    Oct 2010
    Location
    The Big, Bad, World!
    Beans
    120
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Thumbs down Re: Anyone have any Ideas? My Problem with Python!

    Quote Originally Posted by ssam View Post
    you might find this series of posts interesting
    http://en.wordpress.com/tag/pythons-innards/

    it shows what actually happens when you run a piece of python code.
    Thanks for the info everyone, I'll look at those posts in a minute. I think they could add in say once you have created and saved your program, run it debugged it etc, a function that would enable you to build it into an exe file. Seeing as how once it's all saved it's basically static isn't it? The code is there, so surely it can be seen and then converted to .exe?

    When it's being compiled it could just link and list all the references?

    I know this would mean you would need to go through a few more stages to compile it, but it would give Windows users rapid dev cycles.

    Doesn't Iron Python manage to combat this though, using Python Syntax inside the .NET framework, meaning I would in theory be able to make standalone .exe's?
    Last edited by x-D; August 11th, 2011 at 05:26 PM.
    Choose Freedom, Choose Linux, Choose Ubuntu.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •