Skip to content

Instantly share code, notes, and snippets.

View maluta's full-sized avatar

Tiago Maluta maluta

View GitHub Profile
# install gpsd gps-clients and python
import gps
gpsd = gps.gps()
gpsd.stream(gps.WATCH_ENABLE|gps.WATCH_NEWSTYLE)
for report in gpsd:
if report['class'] == 'TPV':
print report['lat']
@maluta
maluta / sena.py
Created April 26, 2012 15:34 — forked from alvesjnr/sena.py
Quantos sorteios para você ganhar na mega sena?
import random
my_numbers = set(random.sample(xrange(1,61),6))
if __name__ == '__main__':
count = 1
while my_numbers != set(random.sample(xrange(1,61),6)):
count += 1
print count