Created
April 21, 2013 08:02
-
-
Save Verurteilt/5428828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
import urllib2 | |
class ExampleCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
the_sels = self.view.sel() | |
the_sels_begin = the_sels[0].begin() | |
the_sels_end = the_sels[0].end() | |
lista = [] | |
for i in range(the_sels_begin, the_sels_end): | |
lista.append(self.view.substr(i)) | |
lista_unida = "".join(lista) | |
nombre_del_archivo = self.view.file_name() | |
url = 'http://localhost:3000/?code=%s&file_name=%s' % ('print', self.view.file_name()) | |
request = urllib2.Request(url, None, {'User-Agent': 'RTC-UA'}) | |
print urllib2.urlopen(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment