944,185 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 8937
  • Python RSS
You are currently viewing page 1 of this multi-page discussion thread
Aug 29th, 2005
0

Interpreted vs. compiled languages

Expand Post »
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
Reputation Points: 55
Solved Threads: 6
Junior Poster
Micko is offline Offline
148 posts
since Aug 2005
Aug 29th, 2005
0

Re: Interpreted vs. compiled languages

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.
Moderator
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Aug 29th, 2005
0

Re: Interpreted vs. compiled languages

the very popular(notorious) program bittorrent is written in python. I wonder if the bittorrent windows executable used Py2Exe.
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005
Aug 30th, 2005
0

Re: Interpreted vs. compiled languages

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.
Moderator
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Aug 30th, 2005
0

Re: Interpreted vs. compiled languages

When Python is installed correctly, Python files should execute just like any other file -- it's just a matter of registering the file extension. It's the same situation as Java.
Team Colleague
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Rashakil Fol is offline Offline
2,480 posts
since Jun 2005
Sep 22nd, 2005
0

Re: Interpreted vs. compiled languages

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
Reputation Points: 26
Solved Threads: 24
Junior Poster
a1eio is offline Offline
140 posts
since Aug 2005
Sep 22nd, 2005
0

Re: Interpreted vs. compiled languages

...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.
Reputation Points: 41
Solved Threads: 31
Junior Poster
G-Do is offline Offline
146 posts
since Jun 2005
Sep 22nd, 2005
0

Re: Interpreted vs. compiled languages

Thats a very good point, i never looked at it that way, and i bet that if you use the py2exe to make a 'portable' program because it ships with the python24dll thingy then maybe thats actually a little more multi-system than a bog standard compiled exe. (then again maybe not hehe all speculation)
Reputation Points: 26
Solved Threads: 24
Junior Poster
a1eio is offline Offline
140 posts
since Aug 2005
Sep 22nd, 2005
0

Re: Interpreted vs. compiled languages

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
Moderator
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Sep 23rd, 2005
0

Re: Interpreted vs. compiled languages

Wehey very nice thats solved my issue
Reputation Points: 26
Solved Threads: 24
Junior Poster
a1eio is offline Offline
140 posts
since Aug 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Add digits untill reaching a single digit
Next Thread in Python Forum Timeline: Algorithim ideas?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC