I posted a thread labeled pygame, global name "glob" but am unable to resolve the issue so I was just going to ask a few question about the code. Well first of all, I ran it on Windows Vista, python 2.6 and pygame, but I'M not sure what version of pygame.

Anyway, in the line font = pygame.font.SysFont("arial", 16), I look up font and I see it's a module named font.py. But in that file, I don't see a calls or function by the name of SysFont. Can anyone please tell me why? Thanks.

Recommended Answers

All 2 Replies

I thought I had the answer to this, but upon closer examination I do not have the answer. I believe it has to do with calling from the SYSTEM itself and not from a module within font.py

This will give you the version of your installed pygame ...

import pygame

print pygame.ver  # for instance --> 1.8.0release

This version has no font.py file, but a font.pyd file which is compiled C code to a DLL for Python use. The pygame file you want to take a look at is sysfont.py

You may have an old version of pygame that uses module glob to search for the font files.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.