Using pyglet with Google App Engine

136 views
Skip to first unread message

Alexandre Blondin Massé

unread,
Aug 30, 2010, 10:41:31 AM8/30/10
to pyglet-users
Hello, everyone,

I would like to code a psychology online experiment and, preferably,
using Python. The thing is, I haven't found any satisfying solution so
far (and I don't want to go back to Java). I've never really used
pyglet (just tried it a few days ago) and it says that it's pure
Python. On the other hand, Google App Engine (which I have never tried
neither) says it accepts only pure Python.

Which leads me to the following question: does Pyglet work with GAE ?
I haven't found anything on the web about that. If it does, are there
any limitations I should be aware of ?

Thank for your help.

Alexandre

Casey Duncan

unread,
Aug 30, 2010, 5:58:11 PM8/30/10
to pyglet...@googlegroups.com
Pyglet is essentially an abstraction on top of OpenGL, and runs
directly on the user's PC. GAE is, of course, a web application
server. The Python bits of GAE run server-side and cannot interact
directly with OpenGL on the client-side as Pyglet requires. Therefore
you cannot run Pyglet on a web server, at least not in such a way that
it can be used interactively. I highly doubt you can run Pyglet at all
under GAE since it uses the ctypes library, and I don't think it would
be useful even if you could.

What is it you are trying to do? There are various ways to serve games
over the web. I don't know of any decent Python-based solutions for
this, presently.

-Casey

> --
> You received this message because you are subscribed to the Google Groups "pyglet-users" group.
> 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.
>
>

Steve

unread,
Aug 30, 2010, 6:18:33 PM8/30/10
to pyglet-users
You are probably looking for something like Processing.js, which
serves a similar function to pyglet, but in the browser in Javascript.

On Aug 30, 10:41 am, Alexandre Blondin Massé

Alexandre Blondin Massé

unread,
Aug 30, 2010, 8:05:31 PM8/30/10
to pyglet-users
>
> What is it you are trying to do? There are various ways to serve games
> over the web. I don't know of any decent Python-based solutions for
> this, presently.
>

Me neither, I've tried to look at the problem in many different ways
(looking at psychopy, pygame, pyglet, etc.) but no solution yet. To
answer your first question, I'm trying to code a psychology
experiment. Basically, I need a special input box that the user must
fill and which dynamically colors some part of the input text as it is
filled. Nothing very big, but I still need some graphic components
that only Java provides.

But thank you both for the fast answers, that pretty much means I'm
going to have to turn to Java.

Greg Ewing

unread,
Aug 30, 2010, 8:21:00 PM8/30/10
to pyglet...@googlegroups.com
Alexandre Blondin Massé wrote:
> Basically, I need a special input box that the user must
> fill and which dynamically colors some part of the input text as it is
> filled. Nothing very big, but I still need some graphic components
> that only Java provides.

I wouldn't be so sure about that. If you can rely on
the browser supporting SVG, there isn't much that you
can't achieve with Javascript these days.

You might like to look into Pyjamas:

http://pyjs.org/

--
Greg

Steve

unread,
Aug 30, 2010, 10:34:46 PM8/30/10
to pyglet-users
Just to clarify, Pyjamas won't let you run pyglet in the browser. That
is pretty much impossible.

devon

unread,
Aug 31, 2010, 6:08:46 PM8/31/10
to pyglet-users
Cool. Time to get to work making a pyglet for html 5 opengl using
pyjamas...

Richard Jones

unread,
Aug 31, 2010, 9:21:22 PM8/31/10
to pyglet...@googlegroups.com
On Wed, Sep 1, 2010 at 8:08 AM, devon <devon.sc...@gmail.com> wrote:
> Cool. Time to get to work making a pyglet for html 5 opengl using
> pyjamas...

Or http://www.skulpt.org/


Richard

Frankie Robertson

unread,
Aug 30, 2010, 8:26:22 PM8/30/10
to pyglet-users


On Aug 31, 1:05 am, Alexandre Blondin Massé
Yes. The potential platforms for browser based applications are:
javascript, java applets or flash (or silverlight but we won't mention
that). But I would also second Steve's suggestion of using Processing
(http://processing.org/) which can be deployed as a java applet or
with the help of processing.js be deployed using javascript.

Getting slightly more OT for the list, it's worth noting that both
jython (older versions at least) and ironpython can be used with java
applets and silverlight respectively, although sandbox limitations
would still prevent the use of pyglet.

Tristam MacDonald

unread,
Sep 6, 2010, 8:43:27 AM9/6/10
to pyglet...@googlegroups.com
On Mon, Aug 30, 2010 at 8:26 PM, Frankie Robertson <frankie....@gmail.com> wrote:

> But thank you both for the fast answers, that pretty much means I'm
> going to have to turn to Java.

Yes. The potential platforms for browser based applications are:
javascript, java applets or flash (or silverlight but we won't mention
that). But I would also second Steve's suggestion of using Processing
(http://processing.org/) which can be deployed as a java applet or
with the help of processing.js be deployed using javascript.

Keep in mind that any of these comes with restrictions to your platform penetration. Javascript works pretty much everywhere, but the newer features such as canvas and OpenGL contexts aren't yet supported by IE (support coming in version 9), and any of Flash/Silverlight/Java will severely restrict the use of mobile devices.

Getting slightly more OT for the list, it's worth noting that both
jython (older versions at least) and ironpython can be used with java
applets and silverlight respectively, although sandbox limitations
would still prevent the use of pyglet.

On the flip side, it shouldn't really be that hard to produce a minimal pyglet-like API for 2D sprite work, that runs on python via Java/Silverlight.

--
Tristam MacDonald
http://swiftcoder.wordpress.com/
Reply all
Reply to author
Forward
0 new messages