pygame-web.github.io icon indicating copy to clipboard operation
pygame-web.github.io copied to clipboard

mention pygame.surfarray in wiki

Open tigercoding56 opened this issue 2 years ago • 2 comments

basically instead of using import pygame and pygame.surfarray you have to import pygame.surfarray

tigercoding56 avatar Jun 27 '23 23:06 tigercoding56

and specifically mention it in the pygbag-code section

tigercoding56 avatar Jun 27 '23 23:06 tigercoding56

In the doc it is specified that when numpy is required, it must be explicitely imported, and that before anything else.

Some modules from pygame need implicit import of numpy, which is against PEP20 Zen of Python "explicit is better than implicit". Implicit can only work when numpy is already installed ( desktop case ) : this is not the case in pygbag : everything that can be detected is downloaded then installed as nothing is installed by default.

This is not specific to pygame, it is the same for any module that has a requirement chain.

pmp-p avatar Jun 29 '23 11:06 pmp-p