Skip to content

Instantly share code, notes, and snippets.

☠️

Santiago Espinosa Saigesp

☠️
View GitHub Profile
@sebdah
sebdah / threading_example.py
Last active Jun 16, 2020
Running a background thread in Python
View threading_example.py
import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
@wenbert
wenbert / Python save image from URL
Created Dec 29, 2010
Python save image from URL
View Python save image from URL
import cStringIO # *much* faster than StringIO
import urllib
import Image
try:
file = urllib.urlopen('http://freegee.sourceforge.net/FG_EN/src/teasers_en/t_gee-power_en.gif')
im = cStringIO.StringIO(file.read()) # constructs a StringIO holding the image
img = Image.open(im)
img.save('/home/wenbert/uploaderx_files/test.gif')
except IOError, e:
You can’t perform that action at this time.