I would like to extract the year from the current date using Python.
In C#, this looks like:
DateTime a = DateTime.Now() a.Year
What
import datetime a = datetime.datetime.today().year
or even (as Lennart suggested)
a = datetime.datetime.now().year
or even
a = datetime.date.today().year