Skip to content

Instantly share code, notes, and snippets.

@Verurteilt
Created April 21, 2013 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Verurteilt/5428828 to your computer and use it in GitHub Desktop.
Save Verurteilt/5428828 to your computer and use it in GitHub Desktop.
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