Category archives: Snaking
Discussions of programming, particularly of programming Python
I forget how advanced TurboGears 2.0 is, sometimes
Written by
on
in
Snaking.
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 ...
First PyGTA Class Begins to Take Shape
Written by
on
in
Snaking.
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 ...
Hack to map Vertex Buffer Objects into Numpy arrays...
Written by
on
in
Snaking.
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 = ...
easy_install no longer working with SourceForge-hosted projects?
Written by
on
in
Snaking.
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 ...
Reminder: Exceptional Conditions at PyGTA this evening!
Written by
on
in
Snaking.
We're going with a round-table discussion at PyGTA this evening. How do *you* deal with exceptional conditions in your code? 7:10pm at Linux Caffe.
Oh, OpenGL 3.2 in PyOpenGL, PyOpenGL in Python 3.x
Written by
on
in
Snaking.
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 ...
Add context managers to PyOpenGL?
Written by
on
in
Snaking.
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 ...
PyGTA on Tuesday: Exceptional Conditions
Written by
on
in
Snaking.
Our open discussion on Tuesday will be on the topic of exceptional conditions (and how to handle them). More details on the PyGTA site.
New tutorial(s) up...
Written by
on
in
Snaking.
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 ...
GLSL tutorial intro to structures and arrays...
Written by
on
in
Snaking.
Moving forward on the GLSL tutorials. Latest introduces the use of structures and arrays. Needs more commentary, but I'm off to friends' for dinner.