Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 01-01-2011, 10:32 PM   #1 (permalink)
Alpha Geek
 
Join Date: Jan 2007
Location: In your hearts
Posts: 828
Default C/C++ IDE in Python


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!!
abhijangda is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 01-01-2011, 10:42 PM   #2 (permalink)
Sami Hyypiä, LFC legend
 
Liverpool_fan's Avatar
 
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,138
Default Re: C/C++ IDE in Python

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
__________________
Experience true education in Computer Science - http://www.udacity.com | http://www.coursera.org

Spoiler:
Read before asking / messaging any moderator for any query: FAQ + answers for new members

Read all the sticky threads before asking any type of query. Most basic questions are answered in those.
Don't use forum for chatting. Visit http://webchat.freenode.net/?channels=krow, enter nick and connect.

Last edited by Liverpool_fan; 02-01-2011 at 10:40 AM. Reason: Automerged Doublepost
Liverpool_fan is offline   Reply With Quote
Old 02-01-2011, 09:18 PM   #3 (permalink)
Alpha Geek
 
Join Date: Jan 2007
Location: In your hearts
Posts: 828
Default Re: C/C++ IDE in Python

Thx for reply, i will try when i will come back to my home.
abhijangda is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2