| | |
Interpreted vs. compiled languages
Thread Solved |
•
•
Join Date: Aug 2005
Posts: 148
Reputation:
Solved Threads: 6
Hello, I'm learning Python. It is my first interpreted language. I have some experience with C and C++. I must admit that it's very hard for me to accept a concept of interpreted language. For example I write code in C++, compile it, link it and I have .exe file which I can send to my friend who doesn't have any C++ compiler or anything and it works. So I can see with my own eyes (and others as well) product and that is .exe program that can be run on different machines. On the other hand, I wrote simple programs (or scripts!?! - don't know difference) in Python, but whenever I want to see result I need to open Python shell. I simply don't have a feeling that I amde something. How to send Python program to my friend who doesn't have Python installed? Is it possible at all?
I'm sorry if this question sounds stupid to you, but I'm really confused. I know that testing and debugging is easier with intepreted language, but how to make a real program in interpreted language?
If anyone can explaine me this issue, it would be greatly appreciated.
Thanks
I'm sorry if this question sounds stupid to you, but I'm really confused. I know that testing and debugging is easier with intepreted language, but how to make a real program in interpreted language?
If anyone can explaine me this issue, it would be greatly appreciated.
Thanks
The Python Shell is only used to test short Python statements. Any regular Python programs are written on the editor of one of the IDEs available.
If your friends have a Unix computer Python is most likely installed. With Windows computers you can encourage your friends to download and install Python or give them an install package on a CD, after all Python is open-source. There is also Py2Exe, a free program to that combines your file with the needed parts of the Python interpreter.
If your friends have a Unix computer Python is most likely installed. With Windows computers you can encourage your friends to download and install Python or give them an install package on a CD, after all Python is open-source. There is also Py2Exe, a free program to that combines your file with the needed parts of the Python interpreter.
May 'the Google' be with you!
The telltale of the product of Py2Exe is that the exe file is accompanied by a runtime package consisting of at least two files one the Library.zip and the other the Python interpreter DLL like Python24.dll. A little similar to the Microsoft .NET languages that need a NET runtime package.
May 'the Google' be with you!
Yea but Micko has a point. it does suck when you want to take a simple short and sweet program you made with python to school or an internet cafe or any other place where you are not allowed to install stuff, i mean py2exe is good but whenever i use it i get a whole load of crap thrown in with the exe and a folder that has 5 or 6 .py files (i know they are needed but it's still anoying), ok it's good if you know where you are going but for quick and easy compilation and running python does lack...a lot
...and that is .exe program that can be run on different machines.
That's not necessarily true. Compiling a C/C++ program does not create a universal executable that can be installed on any machine. Whether the executable will work on your friend's machine depends on (a) what the program does, and (b) what the other machine's architecture is.
This is a larger issue in developing software for general use. If you're writing in a compiled language you're inevitably going to have to deal with a whole lot of architecture-specific compilation issues, which can be a huge pain in the rear, especially after you've just finished coding a large project. Nothing quite takes the wind out of your sails like getting a complex C program to work perfectly on an i386 and then having it consistently and mysteriously screw up on your boss's non-i386 machine.
If you're writing in an interpreted language, on the other hand, the code should, theoretically, be much more portable. Now all the user has to do is download the interpreter, which (again, in theory) ought to be as easy as pie.
That's not necessarily true. Compiling a C/C++ program does not create a universal executable that can be installed on any machine. Whether the executable will work on your friend's machine depends on (a) what the program does, and (b) what the other machine's architecture is.
This is a larger issue in developing software for general use. If you're writing in a compiled language you're inevitably going to have to deal with a whole lot of architecture-specific compilation issues, which can be a huge pain in the rear, especially after you've just finished coding a large project. Nothing quite takes the wind out of your sails like getting a complex C program to work perfectly on an i386 and then having it consistently and mysteriously screw up on your boss's non-i386 machine.
If you're writing in an interpreted language, on the other hand, the code should, theoretically, be much more portable. Now all the user has to do is download the interpreter, which (again, in theory) ought to be as easy as pie.
Vi veri veniversum vivus vici
If you use Windows, you are in luck, you can download Movable Python also called "Python on a Stick" because it is meant to run Python from one of those USB Flash Drives.
Walmart around here sells a 128M USB Flash Drive for less than $20. It's the size of half a finger and is all you need. Install Movable Python on it and whatever program files you have and now you can carry Python with you to your friends Windows computer.
Movable Python is open-source and comes in two flavors, basic and standard. The latest standard version has Python 2.4.1, wxPython, SPE (an IDE), Tkinter, IDLE, Psyco and more. Download from:
http://sourceforge.net/projects/movpy
More info from:
http://www.voidspace.org.uk/python/movpy/index.html
Walmart around here sells a 128M USB Flash Drive for less than $20. It's the size of half a finger and is all you need. Install Movable Python on it and whatever program files you have and now you can carry Python with you to your friends Windows computer.
Movable Python is open-source and comes in two flavors, basic and standard. The latest standard version has Python 2.4.1, wxPython, SPE (an IDE), Tkinter, IDLE, Psyco and more. Download from:
http://sourceforge.net/projects/movpy
More info from:
http://www.voidspace.org.uk/python/movpy/index.html
May 'the Google' be with you!
![]() |
Other Threads in the Python Forum
- Previous Thread: What is Lambda in Python
- Next Thread: Python's Profiler
| Thread Tools | Search this Thread |
abrupt ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui heads homework http ideas import input itunes java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite ssh statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib






