rapidograf
Posts: 279
Joined: Sat Mar 22, 2014 11:03 am
Location: very near from here

Compiller for Python

Mon Feb 16, 2015 5:55 am

Hello

is it possibe to compille programm on Python ? or good crypt programm for make unreadable python programms. :idea: :arrow: :?:
bigest and hugest same as tiny and micro

jimallyn
Posts: 51
Joined: Wed Nov 12, 2014 9:13 am

Re: Compiller for Python

Mon Feb 16, 2015 7:13 am

You might have a look at nuitka. You'll have to compile it from source, I'm sure.

http://nuitka.net/
“So you say you love the poor? Name them.” - Gustavo Gutierrez

jimallyn
Posts: 51
Joined: Wed Nov 12, 2014 9:13 am

Re: Compiller for Python

Mon Feb 16, 2015 7:19 am

I take that back. 'apt-cache search nuitka' does turn it up. I did not try to install it.
“So you say you love the poor? Name them.” - Gustavo Gutierrez

User avatar
paddyg
Posts: 2339
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Compiller for Python

Mon Feb 16, 2015 8:56 am

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.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

rapidograf
Posts: 279
Joined: Sat Mar 22, 2014 11:03 am
Location: very near from here

Re: Compiller for Python

Mon Feb 16, 2015 10:30 am

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 . :(
bigest and hugest same as tiny and micro

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Compiller for Python

Mon Feb 16, 2015 2:35 pm

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.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Python”