This is what I have made:
#!C:\Users\matej\PycharmProjects\SupremeBot\venv\Scripts\python.exe
import datetime
import webbrowser
#ADDING "SHOW WHEN THE BOT STARTS FUNCTION"
itstime = datetime.time(12, 0,)
now = datetime.datetime.today()
print("This is time when the program was started.:")
print(now)
print("This is when it is time to cop!!:")
print(itstime)
#BOT WEB OPEN FUNCTIONALITY"
if now < itstime:
pass
if now == itstime:
webbrowser.open("http://www.supremenewyork.com")
I am now currently having issues with time:
C:\Users\matej\PycharmProjects\SupremeBot\venv\Scripts\python.exe C:/Users/matej/PycharmProjects/SupremeBot/SupremeBot.py
This is time when the program was started.:
2020-04-03 21:11:03.697831
This is when it is time to cop!!:
12:00:00
Traceback (most recent call last):
File "C:/Users/matej/PycharmProjects/SupremeBot/SupremeBot.py", line 26, in <module>
if now < itstime:
TypeError: '<' not supported between instances of 'datetime.datetime' and 'datetime.time'
Process finished with exit code 1
How to solve this? Any ideas how to make it better, faster or just more stable? I would be thankful for any responds.