Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Supreme Cop Bot
#1
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.
Reply
#2
Shouldn't be
webbrowser.open("http://www.python.org")
?
Reply
#3
Yeah thanks.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020