pythonchipmunkpymunk

Is there an environment variable to disable PyMunk/Chipmunk from printing `Loading chipmunk for Linux`


I am trying to run a PyMunk simulation in a subprocess and get a floating point return value from a pipe, however every time I run the simulation I also get stuck with a Loading chipmunk for Linux (64bit) [/home/user/.local/lib/python3.7/site-packages/pymunk/libchipmunk.so message.

I have already disabled the PyGame loading message with an os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1', however I can't find documentation for a similar variable in PyMunk.

I'd like to avoid writing files with the output I require, as its only a single float that I need to get.


Solution

  • This works on Windows, i think it should work also on Linux. From the documentation: To change make sure you import pymunk before any sub-packages and then set the option you want. http://www.pymunk.org/en/latest/pymunkoptions.html

    import pymunkoptions
    pymunkoptions.options["debug"] = False
    import pymunk
    

    So make sure you set the options before any other import.