No Description

Manfraid 9d71866508 Ajout script sunrise 3 years ago
.gitignore c72d7f1c34 initial commit 3 years ago
README.md 9d71866508 Ajout script sunrise 3 years ago
sunrise.py 9d71866508 Ajout script sunrise 3 years ago

README.md

ScriptPython

Sunrise

script permettant de calculer le lever et le coucher du soleil a une date et un lieu précis

from sunrise import sunriseClass
import datetime
import time

thisDay=datetime.date.today()
mySunrise=sunriseClass()
mySunrise.setNumericalDate(thisDay.day,thisDay.month,thisDay.year)
#mySunrise.setLocation(34.052222,-118.243611) # Los Angeles, UTC -8
#mySunrise.setLocation(41.012222,28.975833) # Istanbul, UTC +2
mySunrise.setLocation(48.856667,2.350833) # Paris, UTC +1
#mySunrise.setLocation(46.711667,4.696667) # renseigner votre location 
mySunrise.calculateWithUTC(+(1+time.localtime().tm_isdst))
 
coucher = mySunrise.sunset 
lever = mySunrise.sunrise
print("Heure lever {}".format(mySunrise.sunriseTime))
print("Heure coucher {}".format(mySunrise.sunsetTime))