Member Avatar for leegeorg07

Hi,

I am trying to make a sublime text plugin that will compile some C code, but it uses python for these plugins. I already have a method of using g++ for single files, but I was wondering if anyone knows how to do it for a make file, here is the code for the g++:

import sublime, sublimeplugin, os
class cs(sublimeplugin.TextCommand):
	def run(self, view, args):
		a=view.fileName()
		f="g++ -o '"+a[:-2]+"' '"+a+"'"
		print f
		os.popen(f)

thanks in advance.

Member Avatar for leegeorg07

sublime text, you can find it here

You might have to write some batch files to jump start the C compiler from within Sublime Text's Python extension language. Check with our friends in the C forum of DaniWeb.

Member Avatar for leegeorg07

Oh, OK thanks, I didnt think of that. I guess I should move the thread to C, I will mark this one as solved though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.