Created
September 5, 2013 12:28
-
-
Save cdodd/6449450 to your computer and use it in GitHub Desktop.
Revisions
-
cdodd created this gist
Sep 5, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/usr/bin/python import sys # Get the original and final gravity from the commandline args try: og = float(sys.argv[1]) fg = float(sys.argv[2]) except IndexError: print 'Usage %s <original gravity> <final gravity>' % sys.argv[0] sys.exit(1) # Calculate and print the ABV abv = ((((1.05) * (og - fg)) / fg) / 0.79) * 100 print '%.1f%%' % abv