Skip to content

Instantly share code, notes, and snippets.

@BlogBlocks
Last active December 19, 2017 00:37
Show Gist options
  • Select an option

  • Save BlogBlocks/8fc267a8ca26da3ec96afc8c34334d4e to your computer and use it in GitHub Desktop.

Select an option

Save BlogBlocks/8fc267a8ca26da3ec96afc8c34334d4e to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
"""
Converts a date into a fraction of a year
Usage: Takes two arguments month and day.
python dateTodec.py 2 22
"""
from __future__ import division
import sys
import math
import sys, getopt
MonthNum = int(sys.argv[1])
DateI = int(sys.argv[2])
"""
from PIL import Image
MonthNum = sys.argv[1]
DateI = sys.argv[2]
x=int(MonthNum)
y=int(DateI)
print x, y
#!/usr/bin/python
import sys
MonthNum = int(sys.argv[1])
DateI = int(sys.argv[2])
"""
mn = (MonthNum-1)*30.14
r = mn+DateI-1
op = 365.25/r-365.25
print "fraction: ",r/365.25
print "\n"
print "Notice the change format of print after being turned into an object"
fraction = "fraction: ",r/365.25
print fraction
@BlogBlocks
Copy link
Copy Markdown
Author

made public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment