-1

How can I calculate the illuminated fraction of the Moon using Python3 ?

Date = datetime.date.today()
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
TawnyOwl
  • 31
  • 1
  • Did you try anything yourself? Usually Stackoverflow is here to help you, when you hit a roadblock, not to write complete programs for you. – Bernhard Jul 10 '18 at 08:16
  • The website of PyEphem refers to Stackoverflow, so that's why I ended up here. When I use PyEphem, moon_phase does not seem to work, that's why I asked it in general terms. – TawnyOwl Jul 10 '18 at 10:54
  • 2
    Give us the code in question and the exception/error it throws, otherwise it's hard to help. – Bernhard Jul 10 '18 at 10:58

1 Answers1

2

Okay, I have found the answer :

import datetime

import ephem

date = datetime.date.today()

m = ephem.Moon(date)

print(m.moon_phase)

TawnyOwl
  • 31
  • 1