Control Panel -> Task Scheduler -> TASK -> Edit Task -> Task Settings -> Run command:

Code:
python /volume1/homes/roger/hello.py


Code:
admin@ds416:/volume1/homes/roger$ cat hello.py 
import sys
print(sys.version)


Resulting email notification:

Code:
Dear user,

Task Scheduler has completed a scheduled task.

Task: Example for tfabris
Start time: Wed, 16 Jan 2019 10:42:51 GMT
Stop time: Wed, 16 Jan 2019 10:42:52 GMT
Current status: 0 (Normal)
Standard output/error:
2.7.12 (default, Sep  7 2018, 13:17:37) 
[GCC 4.9.3 20150311 (prerelease)]


Sincerely,
Synology DiskStation
_________________________
-- roger