Category archives: Snaking

Discussions of programming, particularly of programming Python RSS

wx in a VirtualEnv (for RunSnakeRun)

Since I got asked about this in email I'll post it here for the google-verse. Say you want to allow your developers to use RunSnakeRun running in a virtualenv on an Ubuntu distribution.  You'll recall that normally to run RSR as a utility you do:

$ sudo apt-get install python-wxgtk2.8
$ pip install --user SquareMap RunSnakeRun
$ runsnake

That gets a bit more complex when you want to put RSR in a virtualenv (the question was actually how to make this work on many, many workstations using puppet, but you puppet peoples can figure that out). Building wxPython is not ...

Continue reading

RunSnakeRun/Squaremap with wxPython 3.0.0

There is a very minor new release on PyPi to allow Squaremap (and thus RunSnakeRun) to run on wxPython 3.0.0. The only people likely to be affected are those on bleeding-edge distros (Gentoo, Arch) or Windows.  You should be able to

pip install --update SquareMap

To get the latest version. Thanks to Kristof for the fix.

Continue reading

PyOpenGL 3.1.0 final is out

After far too long, and way more changes than originally intended, PyOpenGL 3.1.0 final is now out. The big changes are:

  • Generation of wrappers is substantially more automatic and based on Khronos source-files with annotations from the Chromium/regal project
  • Common code-base for Python 2.6, 2.7, 3.3 and 3.4, Python 2.5 is no longer supported, 2to3 is no longer used
  • Better isolation and pervasive lazy-loading behavior to prevent loading unused libraries (e.g. GLUT in non-GLUT contexts or GLES in OpenGL contexts)
  • Automated wrappers now (generally) allow passing in output arrays *or* having ...
  • Continue reading

    React.js with Django

    So I've been doing a spike test with a project where I'm trying to use React.js to build a front-end to a Django application. The bulk of this application is basic Django forms, posts, page-loads, etc. but there's a number of complex views for scheduling, content uploading etc. As of now I think I'm willing to say that React is going to become part of my toolbox. There are definitely some issues that I gather Facebook has addressed in their "Flux" framework, but that seems to go a bit too far for me.

    Things I ...

    Continue reading

    Found the source of SegFaults on AMD + FreeGLUT

    So the source of the segfaults that I'm seeing on fglrx and FreeGLUT on Kubuntu 14.04 has come to light. It's a known issue with the registration of FreeGLUT and fglrx at-exit handers (at the C level). You can work around it in your own code with PyOpenGL 3.1.0b3+ (which is still pending release) using:

                if fgDeinitialize: fgDeinitialize(False)
            except NameError as err:
                pass # Older PyOpenGL, you may see a seg-fault here...
            import sys
            sys.exit( 0 )

    Where fgDeinitialize is available in the GLUT namespace.

    Continue reading

    Auto-generating Output Declarations

    So the good news is that I've now got far more PyOpenGL output parameters automatically wrapped such that they can be passed in or automatically generated. That drops a *lot* of the manually maintained code. OpenGLContext works with the revisions, but the revision currently does *not* support non-contiguous input arrays (basically the cleanup included removing manually maintained code that said "this is an input array, so allow it to be non-contiguous"). I'll be moving the logic to doing that wrapping into the run-time eventually.

    Upshot, however, is that there are a lot of changes, and while they are ...

    Continue reading

    Enums and Output Variables

    Walter on PyOpenGL Users pointed me at the chromium "regal" tool, which has a table of constant definitions for output parameter sizings. I have a similar mechanism inside PyOpenGL's source code, so I parsed the table out of regal and used it to spot and plug gaps in the PyOpenGL table. The regal stuff is all-one-table for any COMPSIZE() value, while PyOpenGL has traditionally had many tables, one for each output-parameter... seems that could be simplified now to just use the one table, though there are definitely some corner-cases to be addressed (cases where e.g. another API call ...

    Continue reading

    So close on py2exe with PyOpenGL

    I played with getting a py2exe executable created from PyOpenGL today, and it is very close to working.  The basics:

    from distutils.core import setup
    import py2exe
    import glob, os
    import OpenGL
    data_files = [
            glob.glob( os.path.join( os.path.dirname( OpenGL.__file__ ), 'DLLS', '*.*' ))
    if __name__ == "__main__":
                "py2exe": {
                    "includes": [
                        "ctypes", "logging",
                    ] + [
                        'OpenGL.arrays.%s'%x for x in [
                    'skip_archive': True,
            data_files = data_files,

    Which collects all of PyOpenGL's plugins that are applicable for use in Win32 (basically the ...

    Continue reading

    PyOpenGL 3.1.0b2 Available for Testing

    The second (and hopefully last) beta for PyOpenGL 3.1.0 is now available. These are the changes since Beta 1. If there's nothing critical showing up I'll do a final release in a few weeks.

    • Generation fixes (lots of them) 
    • GLES/GL-only extensions should now be generated only in the appropriate directories 
    • Extensions which are multi-api will show up in each API package (note: custom wrappers are still written per-api) 
    • Freshly generated wrappers from the khronos API repository 
    • Late/lazy binding of all entry points (that is, we do not even attempt to resolve any entry point ...

    Continue reading

    OpenGLContext-full working on Ubuntu Again

    pip's changes to not install pre-release software caught me up on my bad habit of just leaving alphas and betas of little-used packages that pass testing up as the "final" release. While I'm going to have to get that habit quashed, I've updated OpenGLContext-full in the meantime to pull the correct betas and have pushed new betas for PyVRML97 and OpenGLContext.  Long story short, you can now do:

    pip install "OpenGLContext-full==3.1.0b1"

    and on Ubuntu 13.10, at least, you'll get a working OpenGLContext environment.  As usual, there are some caveats, such as needing ...

    Continue reading