Page 1 of 1

Compiller for Python

Posted: Mon Feb 16, 2015 5:55 am
by rapidograf
Hello

is it possibe to compille programm on Python ? or good crypt programm for make unreadable python programms. :idea: :arrow: :?:

Re: Compiller for Python

Posted: Mon Feb 16, 2015 7:13 am
by jimallyn
You might have a look at nuitka. You'll have to compile it from source, I'm sure.

http://nuitka.net/

Re: Compiller for Python

Posted: Mon Feb 16, 2015 7:19 am
by jimallyn
I take that back. 'apt-cache search nuitka' does turn it up. I did not try to install it.

Re: Compiller for Python

Posted: Mon Feb 16, 2015 8:56 am
by paddyg
nuitka looks interesting and I might follow that up.

You could use cython to compile functions from within your application, this would have the benefit of (potentially) making those functions run significantly faster.

However compiling code to 'hide' it goes against the philosophies of python, Raspberry Pi, linux and the open source world generally. You will find that even Microsoft and Apple are learning that keeping things secret to force dependency may have longer term negative effects.

If there are really secret things in your code (such as your email or on-line banking passwords) then compiling won't conceal them properly.

Re: Compiller for Python

Posted: Mon Feb 16, 2015 10:30 am
by rapidograf
paddyg wrote: However compiling code to 'hide' it goes against the philosophies of python, Raspberry Pi, linux and the open source world generally. You will find that even Microsoft and Apple are learning that keeping things secret to force dependency may have longer term negative effects.

If there are really secret things in your code (such as your email or on-line banking passwords) then compiling won't conceal them properly.
Unfortunately i live in Russia , and here all free project will commercial if somebody found it.
How do you think how much realised russian projects on RasPi ????? it ner with zero. All material translated by google an put on russian web . or put to paper books and try to sell . here is some commercial cources where by money , but this cources retell only stardand beginner Python book which possibe download free. i'd like hide my programm for that nobody not sell it as "bigest russian technology in last centyry" .......... yuo can see russian robot android - metall man on youtube , ha-ha .... ahhhh .
you newer understand because we live in different worlds . :(

Re: Compiller for Python

Posted: Mon Feb 16, 2015 2:35 pm
by gkreidl
paddyg wrote:nuitka looks interesting and I might follow that up.
I've run some tests today. First I compiled omxplayweerGUI, a single Python script of 64856 bytes. It worked nicely, but
main.ccp size is 1.5 MB and the size of the binary is 800983 bytes!
I couldn't see any measurable speed improvements.

Then I compiled youtube-dl (which is quite slow on the RPi). It gave 10 warnings, but otherwise compiled a working version. Took two hours and the binary is 24882325 bytes!!!
And again I couldn't see any difference in speed; I suppose because loading of the binary takes too long.

But now I know for sure how hot the RPi gets, when it's using all 4 cores at 100%: 67 deg. (normally around 40). In a closed case the temperature would be about 10 deg. higher, I suppose.