Created
September 1, 2012 13:48
-
-
Save danielpclark/3573616 to your computer and use it in GitHub Desktop.
Clock Figure Outer - for converting your time card to decimal number and back.
This file contains 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
print "Clock Figure Outer (CFO) 1.0 - 6ft Dan(TM)" | |
print "Author: Daniel P. Clark" | |
print "Written: <= 2005" | |
def parse(vString): | |
global rval, end | |
if ":" in vString: | |
rval = int(vString[-2:])*100/60 | |
end = "hundredths" | |
return 1 | |
elif "." in vString: | |
if len(vString[3:]) == 1: | |
vString += "0" | |
rval = int(vString[3:])*60/100 | |
end = "minutes past the hour" | |
return 1 | |
else: | |
print "Not Valid!" | |
return 0 | |
x = 1 | |
while x == 1: | |
end = "" | |
ui = raw_input("Enter clock value: ") | |
if ui in ("q", "quit"): | |
x = 0 | |
break | |
if parse(ui): | |
print rval, end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment