#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    9
    Rep Power
    0

    Bugs in python 3.3.3


    Hi I have python 3.3.3 and pygames installed on my windows 7 computer.I have copied several pygames and saved them and on my computer.I'm trying to learn on how to write game programs.

    They have all been working fine until now.when I bring up python shell and when I tried to load a recent file all it does is flash real fast on the screen and disappear.The shell comes up fine.Does that mean the exe file of python is corrupt and need to be re-installed?

    I hope I explained this ok.I have quite a few game codes typed in.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    I have not tried python 3.3.3. If your programs worked with an earlier version of python continue to use that prior version of python.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    618
    Rep Power
    65
    This work just fine on a Window7 box ...
    Code:
    ''' PG_AnimatedLine.py
    move a line down and up the display window
    modified from: http://wordpress.com/tag/pygame-tutorial/
    tested with Python 3.3.3 and pygame-1.9.2a0
    '''
    
    import pygame as pg
    
    linecolor = 255, 0, 0  # red
    #bgcolor = 0, 0, 0  # black
    bgcolor = 255, 255, 255  # white
    
    y = 0
    dir = 1
    width = 800
    height = 600
    screen = pg.display.set_mode((width, height))
    pg.display.set_caption('Draw animated line')
    
    running = True
    while running:
        event = pg.event.poll()
        # quit when window corner x is clicked
        if event.type == pg.QUIT:
            running = False
    
        screen.fill(bgcolor)
        pg.draw.line(screen, linecolor, (0, y), (width-1, y))
    
        y += dir
        # reverse direction if line hits bottom or top
        if y == 0 or y == height-1:
            #dir *= -1
            dir = -dir
        # update the display
        pg.display.flip()
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    9
    Rep Power
    0
    Thanks for your answer.

    What I don't understand is that all the programs I have in python 3.3.3 (around 20 ) have worked for the last two months.Why all of the sudden I can't load them.

    Like I said the python shell comes up and when I try to click on the game,everything disappears including the shell.
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    618
    Rep Power
    65
    I usually work from an IDE (hate the shell).
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    something changed. Remote diagnosis difficult. Sure, reinstall python. I usually work from bash running in emacs (hate the IDEs).
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo