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
#!/usr/bin/env python | |
from subprocess import * | |
import os | |
sdlconf = Popen(['sdl-config', '--prefix'], stdout=PIPE).communicate()[0] | |
pkgconf = Popen(['pkg-config','sdl', '--libs'], stdout=PIPE).communicate()[0] | |
if sdlconf: | |
prefix = sdlconf | |
elif pkgconf: |
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 time | |
daynum=int(time.strftime('%j')) | |
year=int(time.strftime('%y')) | |
composite=(year*365)+daynum | |
def ordinal(n): | |
if 10 <= n % 100 < 20: | |
return str(n) + 'th' | |
else: | |
return str(n) + {1 : 'st', 2 : 'nd', 3 : 'rd'}.get(n % 10, "th") | |
#thanks http://stackoverflow.com/questions/739241/python-date-ordinal-output/739301#739301 |
NewerOlder