473,545 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python to C converter

Hi All,

I have an application return in python. I want this to be
converted to C. I will be kind enough if somebody suggest is there any
tool or compiler to do that.

Regards-
Praveen Kumar A.S

Jun 5 '06 #1
7 15309
pr************* *@gmail.com:
I have an application return in python. I want this to be
converted to C.


http://www.python.org/doc/faq/genera...other-language

--
René Pijlman
Jun 5 '06 #2

Rene Pijlman wrote:
pr************* *@gmail.com:
I have an application return in python. I want this to be
converted to C.


http://www.python.org/doc/faq/genera...other-language


http://pyfaq.infogami.com/can-python...other-language
shd probably mention Shedskin, boost, ctypes, any others?

Jun 5 '06 #3

gene tani wrote:
Rene Pijlman wrote:
pr************* *@gmail.com:
I have an application return in python. I want this to be
converted to C.


http://www.python.org/doc/faq/genera...other-language


http://pyfaq.infogami.com/can-python...other-language
shd probably mention Shedskin, boost, ctypes, any others?


The PyPy LLVM backend will compile Python code to C.

Also Pyrex can do a bit more than just integrate C with Python, AFAIK
it *can* compile some Python to C - although with very little speed
advantage if you don't use native C types.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

Jun 5 '06 #4
gene tani wrote:
http://pyfaq.infogami.com/can-python...other-language
shd probably mention Shedskin, boost, ctypes, any others?


I've added a comment, which is seemingly all that can be done right now
on that page. See also this overview I wrote about Python and attempts
at compilation/translation:

http://groups.google.co.uk/group/com...785816bf5de6b1

Paul

Jun 5 '06 #5
If you are looking for a "real" python to C, well in this case
C++ look for the shedskin compiler. It will take a rather
nice subset of Python and generate C++ code from it.

It is still rather experimental but I have been using it.

Chance G.

On Mon, 05 Jun 2006 07:19:39 -0700, Fuzzyman wrote:

gene tani wrote:
Rene Pijlman wrote:
> pr************* *@gmail.com:
> >I have an application return in python. I want this to be
> >converted to C.
>
> http://www.python.org/doc/faq/genera...other-language
>


http://pyfaq.infogami.com/can-python...other-language
shd probably mention Shedskin, boost, ctypes, any others?


The PyPy LLVM backend will compile Python code to C.

Also Pyrex can do a bit more than just integrate C with Python, AFAIK
it *can* compile some Python to C - although with very little speed
advantage if you don't use native C types.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml


Jun 5 '06 #6
Chance Ginger wrote:
If you are looking for a "real" python to C, well in this case
C++ look for the shedskin compiler. It will take a rather
nice subset of Python and generate C++ code from it.

In which sense is shedskin a more "real" python to C/C++ compiler than
some of the other mentioned projects? As most of the others (PyPy,
Pyrex), Shedskin works only for a small number of Python programs that
don't mix types too wildly.

BTW: While the RPython (the subset of the Python language that PyPy can
compile) might not be extremely advanced, using it gives you a number of
very interesting features: like having the resulting program been
enhanced to not use the C stack (for deeply recursive code), using
different garbage collection strategies...

Cheers,

Carl Friedrich Bolz

Jun 7 '06 #7
Isn't Pyrex for writing extensions to Python? As for PyPy, I
didn't scroll down far enough to see the compiler info. It
does say it is Python written in Python at the top.

Shedskin is nothing but a compiler.

On Wed, 07 Jun 2006 19:13:27 +0200, Carl Friedrich Bolz wrote:
Chance Ginger wrote:
If you are looking for a "real" python to C, well in this case
C++ look for the shedskin compiler. It will take a rather
nice subset of Python and generate C++ code from it.

In which sense is shedskin a more "real" python to C/C++ compiler than
some of the other mentioned projects? As most of the others (PyPy,
Pyrex), Shedskin works only for a small number of Python programs that
don't mix types too wildly.

BTW: While the RPython (the subset of the Python language that PyPy can
compile) might not be extremely advanced, using it gives you a number of
very interesting features: like having the resulting program been
enhanced to not use the C stack (for deeply recursive code), using
different garbage collection strategies...

Cheers,

Carl Friedrich Bolz


Jun 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2226
by: Max Ischenko | last post by:
Hi, I've started to develop under Microsoft ASP framework, which allows different lang. used in a ActiveX page. I wonder about possible strategies to use Python modules from VBScript <%%> includes. Right now I'm thinking about this approaches: - create a COM server in Python to be able to call it from VB. Drawbacks: cumbersome and...
3
9022
by: Thys Meintjes | last post by:
Greets, I have need of a Delphi/pascal to python converter. Googling didn't suggest any obvious leads so I'm trying here... Thanks Thys
96
6258
by: Gustav Hållberg | last post by:
I tried finding a discussion around adding the possibility to have optional underscores inside numbers in Python. This is a popular option available in several "competing" scripting langauges, that I would love to see in Python. Examples: 1_234_567 0xdead_beef 3.141_592
2
4432
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c */ #include <time.h>
0
966
by: Brian Blais | last post by:
Hello, I was wondering if anyone has written a converter between python code and NQC (http://bricxcc.sourceforge.net/nqc/) used for programming LEGO Mindstorms? I am thinking that a small modification to Pyrex might be used, but I am not sure how to proceed with something like that. I was thinking that 90% of it could be done by...
0
262
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 416 open (-14) / 3463 closed (+16) / 3879 total ( +2) Bugs : 930 open ( +8) / 6333 closed (+17) / 7263 total (+25) RFE : 244 open ( -1) / 244 closed ( +3) / 488 total ( +2) New / Reopened Patches ______________________
11
4889
by: Osiris | last post by:
I have these pieces of C-code (NOT C++ !!) I want to call from Python. I found Boost. I have MS Visual Studio 2005 with C++. is this the idea: I write the following C source file: ============================ #include <iostream> #include <stdafx.h>
10
14813
by: mm | last post by:
Is there a Perl to Python converter? Or in general: a XY to Python converter? Is see, that Python is much better then Perl anyway. But for beginners, they whant to konw how is this done with Python etc. Sure, there are some docus out there in the internet. But a converter?
1
6574
by: luca | last post by:
Hi, I was trying to make to work directly l i2c with python with the calls ioctl. But I have of the problems and I do not succeed to go ahead. this and l error 129# python pcf8591_ioctl.py Reading from 4 ch 8 bit A/D converter PCF8591 Traceback (most recent call last):
2
1644
by: =?ISO-8859-1?Q?Michael_Str=F6der?= | last post by:
HI! I had a look on how Doc/ is organized with Python 2.6. There are files with suffix .rst. Hmm... I'm maintaing existing docs for python-ldap which I might have to convert to the new concept in the long run. What's the recommended procedure for doing so? Any pointer? Ciao, Michael.
0
7486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7676
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7442
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7776
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6001
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.