This file contains hidden or 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
# 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'] |
This file contains hidden or 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 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 |