DIGIT-ARC read-only archive · snapshot: July 23, 2026

C/C++ IDE in Python

3 posts · originally from https://geek.digit.in/community/threads/c-c-ide-in-python.135595/

A
abhijangda Original post #1
Jan 1, 2011 at 10:32 PM
Hello friends, for some time I have been working on an IDE for C/C++ written in Python. Finally, I was able to develop it with help of PyQt4, but still one thing is remaining. Can anyone of you please tell me, how can I integrate GCC or G++ compiler in my program. By integration I mean, how can I compile, run and displays errors in program code, when user clicks Run button. Just like we have in other IDEs. I am working on Fedora 14. Please tell me how to do that. Even if you just have a small hint please do tell that. Thanks in advance!! :)
Liverpool_fan
Jan 1, 2011 at 10:42 PM
System Call?

Code:
import os
r = os.system("gcc filename.c > /tmp/output")
f = open("/tmp/output")
Using a combination of redirection should work well.
That f contains link to the file which contains the output.

For outputting you can create a process running xterm which will run a bash script which executes the file, and then use read such that it waits for user's input before exiting.

Though I doubt it's the best way to be very honest.

This will be immensely useful I think

17.1. subprocess ? Subprocess management — Python v2.7.1 documentation
A
Jan 2, 2011 at 9:18 PM
Thx for reply, i will try when i will come back to my home.