[Tutor] printing a list to a window

Alan Gauld alan.gauld at btinternet.com
Wed Jun 17 02:40:04 CEST 2009

"Essah Mitges" <e_mitges at hotmail.com> wrote

> What I am trying to do is print a high score text file 
> to a pygame window it kinda works...

How do you define kinda?
It doesn't look like it works to me.

The function main defined as

def main():
    high_file = open_file("high_score.txt", "r")
    score = next_block(high_file)
    global score

score is a local variable and has a value assigned
Then you use gloobal which will have no affect so far 
as I can tell.

Finally this function is being replaced by the 
second function main you defined.

You might like to try getting it to work by printing on a 
console first! Then worry about the GUI bits.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list