I'm new to python, and am programming on a Raspberry Pi. I created this script that I want to send an email at a certain time of day (i.e. 6am). I already have the email portion of the script functional, all that is left is the automation of the email.
I figured the best way to do this was to put it in a if-statement. I'm using the import timedate for the time functionality. Here is what I have of the if-statement:
import smtplib
import datetime
import time
now = date time.datetime.now()
morning = 6
noon = 12
afternoon = 18
if datetime.time.hour(6) == morning or datetiem.time.hour(12) == noon or datetime.time.hour(18) == afternoon:
# Email code here #
When I run it currently, I get a TypeError: 'getset_discriptor' is not callable. Because i'm new to Python, I have no idea really how to fix this, so any help is much appreciated!