Path: csiph.com!usenet.pasdenom.info!news.izac.org!ohm.izac.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'skip:[ 20': 0.04; 'syntax': 0.04; 'none:': 0.07; 'versions.': 0.07; 'lawrence': 0.09; 'none):': 0.09; 'pep': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'try:': 0.09; 'python': 0.11; 'def': 0.12; 'changes': 0.15; '(0,': 0.16; '0),': 0.16; 'filename)': 0.16; 'filename):': 0.16; 'list"': 0.16; 'pygame': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'red,': 0.16; 'subject:Pygame': 0.16; 'url:whatsnew': 0.16; 'subject:python': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'work,': 0.20; 'example': 0.22; 'import': 0.22; 'load': 0.23; 'header:User-Agent:1': 0.23; 'error': 0.23; 'copied': 0.24; 'fixed.': 0.24; 'tutorials': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'raise': 0.29; 'bunch': 0.31; 'strip': 0.31; 'class': 0.32; 'run': 0.32; 'url:python': 0.33; 'guess': 0.33; 'skip:_ 10': 0.34; 'subject:with': 0.35; 'except': 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'var': 0.36; 'url:org': 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'most': 0.60; 'url:3': 0.61; 'email addr:gmail.com': 0.63; 'show': 0.63; 'url:0': 0.67; 'dont': 0.67 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Pygame with python 3.3.2 Date: Wed, 09 Oct 2013 08:19:31 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-20-8.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381303187 news.xs4all.nl 15896 [2001:888:2000:d::a6]:44320 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56477 On 09/10/2013 08:03, markotaht@gmail.com wrote: > From pygame tutorials i copied this example: > import pygame > > class spritesheet(object): > def __init__(self, filename): > try: > self.sheet = pygame.image.load(filename).convert() > except pygame.error, message: > print('Unable to load spritesheet image:', filename) > raise SystemExit, message > # Load a specific image from a specific rectangle > def image_at(self, rectangle, colorkey = None): > "Loads image from x,y,x+offset,y+offset" > rect = pygame.Rect(rectangle) > image = pygame.Surface(rect.size).convert() > image.blit(self.sheet, (0, 0), rect) > if colorkey is not None: > if colorkey is -1: > colorkey = image.get_at((0,0)) > image.set_colorkey(colorkey, pygame.RLEACCEL) > return image > # Load a whole bunch of images and return them as a list > def images_at(self, rects, colorkey = None): > "Loads multiple images, supply a list of coordinates" > return [self.image_at(rect, colorkey) for rect in rects] > # Load a whole strip of images > def load_strip(self, rect, image_count, colorkey = None): > "Loads a strip of images and returns them as a list" > tups = [(rect[0]+rect[2]*x, rect[1], rect[2], rect[3]) > for x in range(image_count)] > return self.images_at(tups, colorkey) > > When ever i run it i get syntax error on this line except pygame.error, message: > There are no example to show what happens, because, this doesent even work, untile the error is fixed. My guess is, that this has something to do with the python versions. But im not very familiar with the changes so i dont know how to fix it. > From http://docs.python.org/3.0/whatsnew/3.0.html "Change from except exc, var to except exc as var. See PEP 3110." You might also like to see this http://docs.python.org/3/howto/pyporting.html -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence