Category archives: Snaking

Discussions of programming, particularly of programming Python

RSS feed of Snaking

I forget how advanced TurboGears 2.0 is, sometimes

I wanted to code up a single-form application for updating/editing the PyGTA events.  Since it runs on Vex and I didn't want to bother them with setting up per-user WSGIs or TurboGears for me (they do give me the space free, after all), I went with bald CGI.

Wow.

I've written very large CGI-only systems ...

Continue reading

First PyGTA Class Begins to Take Shape

We had a lively PyGTA this evening on the topic of concurrency.  After which I put out a call for those who are interested in helping setup and teach (low-cost) courses on Python.

Our first course looks to be an Introduction to Django, likely on a Saturday in early November, taught by a consultant who ...

Continue reading

Hack to map Vertex Buffer Objects into Numpy arrays...

This post from the numpy list shows you how to turn a ctypes c_void_p into a numpy array.  The glMapBuffer() function maps your currently-bound array into a void * which you can access directly... combining the two:

def map_buffer( vbo, access=GL_READ_WRITE ):
    """Map the given buffer into a numpy array..."""
    func = ctypes.pythonapi.PyBuffer_FromMemory
    func.restype = ...

Continue reading

easy_install no longer working with SourceForge-hosted projects?

It seems like all of the projects I host on SourceForge are no longer easy-installable.  The only ones that can install are the ones that have been uploaded to PyPI, and then only the versions on PyPI install (i.e. a later version on SF doesn't install or prevent an earlier version from installing).  I'm guessing ...

Continue reading

Oh, OpenGL 3.2 in PyOpenGL, PyOpenGL in Python 3.x

Checked in the initial OpenGL 3.2 support, haven't done *any* checking on it yet.  So buyer beware on bzr trunk :) .  Really do need to get the pyglet-generator branch working some day.

Oh, also ran 2to3 across the package.  It finished (used to blow up on the larger files), so it may be possible ...

Continue reading

Add context managers to PyOpenGL?

Playing a bit with Python context managers for PyOpenGL.  Considering adding them pervasively, likely with a configuration flag. (idea is from Florian's gletools)...

  • OpenGL.arrays.VBO -- make a context manager itself (this is already implemented)
  • OpenGL.GL.compileShader -- make the shader int returned a context manager (implemented)

Those two I consider non-controversial, as they are already non-standard ...

Continue reading

New tutorial(s) up...

Continuing to plow through writing tutorials.  There's now 10 GLSL code walk through style tutorials for OpenGLContext.  Next up should likely be texturing/samplers.  I'm going to have to start factoring out some of the common code, as large blocks are basically the same for each tutorial and they're making it somewhat cumbersome.  I'm also thinking ...

Continue reading