Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
from graphics import *
#1
I am attempting to follow a tutorial however my code keeps failing in the first line.
"setBackground" and "color_rgb()" both auto filled so I know that my import has worked and it is recognizing "graphics".
However my code is still failing in the first line with this return.
Traceback (most recent call last):
File "C:/First_Try/main.py", line 1, in <module>
from graphics import *

from graphics import *
def main():
win=GraphWin("My Window",500,500)
win.setBackground(color_rgb(255,0,0))

win.getMouse()
win.close()

main()
Reply


Messages In This Thread
from graphics import * - by jmaloney413 - Oct-17-2018, 10:05 PM
RE: from graphics import * - by Larz60+ - Oct-17-2018, 11:24 PM
RE: from graphics import * - by perfringo - Oct-18-2018, 08:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python graphics kaltenherz 1 2,375 Sep-05-2021, 05:19 PM
Last Post: jefsummers
  Graphics py not found vnc 13 30,723 Apr-05-2017, 05:36 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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