pyglet interactive console

132 views
Skip to first unread message

Jordi P. Bou

unread,
May 7, 2010, 9:03:34 PM5/7/10
to pyglet-users
Hello everyone.

I'm new to this list so let me introduce myself. I'm Jordi from Spain.
I'm a newbie to Python coming from other programming languages. Of
course, I'm a newbie to pyglet too.

I love python interactive console but not being able to use pyglet
from there is very annoying, because I think it's a great library. I
don't want to use threads, and that was the only thing I could found,
until I saw code.InteractiveConsole and then decided to program a
python/pyglet interactive console.

I have a working version. Now it's possible to do almost anything one
can do from python console, but always inside pyglet event loop, so
it's possible to create new windows, attach handlers, draw in the
background of the console text and so on.

The only thing changed from pyglet library has been in the event_loop.
First I decided to write my own event loop but I thought pyglet's
event loop was already done, so it was a waste of time. So I adapted
pyglet event loop extracting everything from the loop to a iterate()
function so I can call from elsewhere.

I would love to share it with everyone but I don't know how to attach
a file here or uploading. It's only three files, the console.py
script, and the modified win32.py and xlib.py from pyglet.app (they
are more adaptations than modifications, because it's only copy/paste
to create two new functions, pre_run() and iterate(), run() then calls
them)

I hope this is interesting to someone, because I'm sure there will be
problems using this console with existing scripts. But I think it's a
good idea and I'm very interested in hearing every suggestion/critics
to it.

Jordi P. Bou



--
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.

George Oliver

unread,
May 8, 2010, 2:17:55 PM5/8/10
to pyglet...@googlegroups.com
On 5/7/2010 6:03 PM, Jordi P. Bou wrote:
> I hope this is interesting to someone, because I'm sure there will be
> problems using this console with existing scripts. But I think it's a
> good idea and I'm very interested in hearing every suggestion/critics
> to it.
>


I know I'd like to check it out. You could set up a project on Google
code to host it, or just create a Google site, or use some other free
file host. Also take a look at pyedpypers.org (a community site for
Python game dev) which has project hosting, though I'm not sure if new
members can upload files right away.

You can also attach files to Google groups but I'm not sure if that's
working currently for the pyglet list.

It'd be interesting to extend this to include a livecoding or code
reloading component, perhaps with the livecoding module
(http://code.google.com/p/livecoding/).

Jordi P. Bou

unread,
May 8, 2010, 3:17:06 PM5/8/10
to pyglet-users
Hi George,

Glad to see interest in this console. I've never hear from livecoding
before but I find it very interesting. I will download and give it a
try.

I've finally find a way to put it online. I don't feel like creating a
google project because the script needs the small changes in
pyglet.app.event_loop, and I don't want to put it anywhere without
authorization from pyglet creator/s.

Here's the link (6,4KB):

http://dl.dropbox.com/u/5923122/console.zip

If using a mac, I've not changed the mac version of the event loop
because I don't have one here to try it, but it's very easy to adapt
the changes looking at one of the other two (win32.py or xlib.py).

Jordi
Message has been deleted
Message has been deleted

Jordi P. Bou

unread,
May 11, 2010, 6:02:27 AM5/11/10
to pyglet-users
Hi,

I've tried livecoding and I think is a great tool to add to the
console.

Any ideas about how to add to the console to be useful?

One way would be importing it before creating the interpreter,
possibly passing the
path/s to reload as parameters.

Jordi

George Oliver

unread,
May 13, 2010, 11:11:22 PM5/13/10
to pyglet...@googlegroups.com
On 5/11/2010 3:02 AM, Jordi P. Bou wrote:
> Hi,
>
> I've tried livecoding and I think is a great tool to add to the
> console.
>
> Any ideas about how to add to the console to be useful?
>
> One way would be importing it before creating the interpreter,
> possibly passing the
> path/s to reload as parameters.
>

sorry for the late response, I just got some time to play around with
the console, it's really neat! This is also something of a coincidence,
as I recently have been doing things with fluxus:

http://www.pawfal.org/fluxus/

There's a video here:

http://bit.ly/df4DPS

So, what if there was something like that for Python? The basic elements
-- the console, the livecoding module, and pyglet are there.

Now fluxus does some specific things with sound/image processing that is
on another level, but getting the basic environment set up could be
quite interesting I think.

With the livecoding module, I think you can still add your own modules
to be reloaded to the Reloader at almost any time; before creating the
interpreter would be convenient, but probably not the only way. I'm not
sure about this though.

Jordi P. Bou

unread,
May 16, 2010, 7:12:10 PM5/16/10
to pyglet-users
Hi George,

Thanks for trying it.

After hearing about livecoding library from you I started looking
around Internet and found fluxus too.
It's a very interesting project.

I like your ideas about doing something like fluxus for Python, but I
don't have enough time right now
to work in a project like this. Also, I think livecoding is very
interesting, but probably some kind of ide
or ways to save your works would be interesting.

Jordi

Ben

unread,
May 18, 2010, 2:58:43 AM5/18/10
to pyglet-users
fyi glipy was built with pyglet too if i recall correctly -->
http://webloria.loria.fr/~rougier/coding/glipy/index.html

its abandoned but may have some helpful stuff in..

Cheers,
B

Naveen

unread,
Apr 19, 2012, 10:11:17 AM4/19/12
to pyglet...@googlegroups.com
ipython includes support for pyglet now :)
Reply all
Reply to author
Forward
0 new messages