NameError

Cai Gengyang gengyangcai at gmail.com
Wed Nov 23 22:02:47 EST 2016


I tried to import pygame by using these commands ------------------------------------------------https://www.google.com.sg/#q=how+to+import+pygame

but this is the error I got :

CaiGengYangs-MacBook-Pro:~ CaiGengYang$ sudo apt-get install python-pygame
sudo: apt-get: command not found



On Thursday, November 24, 2016 at 10:54:20 AM UTC+8, Joel Goldstick wrote:
> On Wed, Nov 23, 2016 at 9:44 PM, Cai Gengyang <gengyangcai at gmail.com> wrote:
> >>>> pygame.draw.rect(screen, BROWN, [60, 400, 30, 45])
> > Traceback (most recent call last):
> > File "<pyshell#3>", line 1, in <module>
> > pygame.draw.rect(screen, BROWN, [60, 400, 30, 45])
> > NameError: name 'pygame' is not defined
> >
> > How to solve this error ?
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> 
> have you imported pygame?
> 
> -- 
> Joel Goldstick
> http://joelgoldstick.com/blog
> http://cc-baseballstats.info/stats/birthdays



More information about the Python-list mailing list