PyZero in PyCharm doesn't recognize `screen` variable

I use simple example from PyZero tutorial in PyCharm

import pgzrun

WIDTH = 300
HEIGHT = 300

def draw():
    screen.fill((128, 0, 0))

pgzrun.go()

The variable `screen` is highlighted as error - Unresolved reference 'screen' 

There is suggestion to import it, but if I do so the program fails with error “AttributeError: 'NoneType' object has no attribute 'surface'”

If I don't import it program works without issues. 

 

Is there a way to get rid off this error so I do have autocomplete for built-in PyZero components.

 

0

请先登录再写评论。