Re: do not understand:

203 views
Skip to first unread message

Andreas Schiefer

unread,
Jul 15, 2012, 2:43:11 AM7/15/12
to pyglet...@googlegroups.com
Hi,

the pyglet source code has to be converted with 2to3 to work with Python 3.x.
If you install pyglet via "setup.py install", this happens
automatically if you use Python 3.

Otherwise, if you want to use pyglet without installing it, you can
run the conversation manually:

[extract the zip file]
$ cd pyglet
$ 2to3 -w -n pyglet
$ 2to3 -w -n examples

the above commands convert the pyglet module source and the examples.


Andy


On Sat, Jul 14, 2012 at 6:37 PM, PKHG <pkhgr...@gmail.com> wrote:
> Hallo,
> downloaded from http://code.google.com/p/pyglet/downloads/list
> pyglet-1.2alpha1.tar.gz
> and it is announced to be for Python 3
>
> BUT this error message shows that it is NOT???!!
> C:\pyglet-1.2alpha1>\Python32\python.exe
> Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pyglet
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "pyglet\__init__.py", line 276
> print '[%d] %s%s %s' % (thread, indent, name, location)
> ^
> SyntaxError: invalid syntax
>
> Python 3.2 needs brackets around parameters of print , doen't it?
>
> So what am I missing?
> Peter
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pyglet-users/-/9gziXQi-CTMJ.
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to
> pyglet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pyglet-users?hl=en.

PKHG

unread,
Jul 15, 2012, 7:24:23 AM7/15/12
to pyglet...@googlegroups.com
Thanks a lot
Works showing kitten.jpg with:

import pyglet
window = pyglet.window.Window()
kitten_stream = open('kitten.jpg', 'rb')
kitten = pyglet.image.load('kitten.jpg', file=kitten_stream)
#image = pyglet.resource.image('kitten.jpg')
@window.event
def on_draw():
    window.clear()
    kitten.blit(0, 0)
pyglet.app.run()

Happy Peter!



Op zondag 15 juli 2012 08:43:11 UTC+2 schreef Andreas Schiefer het volgende:
> pyglet-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages