Python Forum
Supreme Cop Bot - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Supreme Cop Bot (/thread-25569.html)



Supreme Cop Bot - MASO - Apr-03-2020

Hi there!
I am python beginer and I am stuck on this new project. Cry Big Grin
I was trying to make basic function for my "bot".


This is what I have made:


#!C:\Users\matej\PycharmProjects\SupremeBot\venv\Scripts\python.exe

from datetime import datetime
import webbrowser


#ADDING "SHOW WHEN THE BOT STARTS FUNCTION"
itstime = datetime.time(12, 0, 0)
now = datetime.datetime.today()

print(now)
print(itstime)


#BOT WEB OPEN FUNCTIONALITY"
if now == itstime:
    webbrowser -t "http://www.python.org"
Now this is what I have got:

Error:
C:\Users\matej\PycharmProjects\SupremeBot\venv\Scripts\python.exe C:/Users/matej/PycharmProjects/SupremeBot/SupremeBot.py File "C:/Users/matej/PycharmProjects/SupremeBot/SupremeBot.py", line 17 webbrowser -t "http://www.python.org" ^ SyntaxError: invalid syntax Process finished with exit code 1
Please help this lost soul :( and be nice.


RE: Supreme Cop Bot - Mateusz - Apr-03-2020

Shouldn't be
webbrowser.open("http://www.python.org")
?


RE: Supreme Cop Bot - MASO - Apr-03-2020

Yeah thanks.