Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread kramer65
Hello,

I'm using Python for a while now and I love it. There is just one thing I 
cannot understand. There are compilers for languages like C and C++. why is it 
impossible to create a compiler that can compile Python code to machinecode?

My reasoning is as follows:
When GCC compiles a program written in C++, it simply takes that code and 
decides what instructions that would mean for the computer's hardware. What 
does the CPU need to do, what does the memory need to remember, etc. etc. If 
you can create this machinecode from C++, then I would suspect that it should 
also be possible to do this (without a C-step in between) for programs written 
in Python.

Where is my reasoning wrong here? Is that because Python is dynamically typed? 
Does machinecode always need to know whether a variable is an int or a float? 
And if so, can't you build a compiler which creates machinecode that can handle 
both ints and floats in case of doubt? Or is it actually possible to do, but so 
much work that nobody does it?

I googled around, and I *think* it is because of the dynamic typing, but I 
really don't understand why this would be an issue..

Any insights on this would be highly appreciated!

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


Installation on Mac OSX 10.6.8 doesn't create the folder: /System/Library/Frameworks/Python.framework/Versions/2.7/

2013-04-02 Thread kramer65
Hello people,


I installed python 2.7 on Mac OSX 10.6.8 with no problems  and it is working 
fine. When I try to install Kivy however (www.kivy.org), I get an error saying:

/usr/local/bin/kivy: line 24: 
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7: No such 
file or directory
/usr/local/bin/kivy: line 24: exec: 
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7: cannot 
execute: No such file or directory

Upon inspection the there are folders named 2.3, 2.5 and 2.6 in the Versions 
folder, but indeed no folder named "2.7". When I log into the interactive 
python command line however, it clearly says I've got python 2.7.3 installed.

Does anybody know what the problem might be here?


Kind regards,
kramer
-- 
http://mail.python.org/mailman/listinfo/python-list