User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Possible to convert python script into C/C++ Pi executable ?

Thu Aug 08, 2013 11:14 am

Is it possible to convert python script into C/C++ Pi executable? I have heard of it, but want to know if it's true. Thankjs :D
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

User avatar
RaTTuS
Posts: 10482
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Possible to convert python script into C/C++ Pi executab

Thu Aug 08, 2013 11:16 am

not as such...
but if you know what you are doing then you can re-make it as c++
why do you want to convert it ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Possible to convert python script into C/C++ Pi executab

Thu Aug 08, 2013 11:17 am

Not that I am saying there is anything wrong with your request, but the obvious question is : Why?

What problem are you trying to solve?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: Possible to convert python script into C/C++ Pi executab

Fri Aug 09, 2013 10:16 am

I was just wondering if I could convert one of my python scripts into C or C++ so that it would become faster, and no-one could see the code. And for me, it would be easier to write a program in python, and then convert it, instead of learning to write C/C++ . :D
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.


robquant
Posts: 3
Joined: Wed Oct 10, 2012 1:55 pm
Location: Berlin

Re: Possible to convert python script into C/C++ Pi executab

Wed Aug 14, 2013 2:17 pm

Cython (cython.org) also offers the possibility to compile pure python code to an executable. However to gain substantial speedups you need to provide types. And you will still depend on any python module you import in your code.

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: Possible to convert python script into C/C++ Pi executab

Sat Aug 17, 2013 3:17 pm

Ok thanks everyone.
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

Return to “C/C++”