Search code examples
python-3.xgraphicsexportvpython

How can I export vpython pictures


I wanted to export the raw images produced using vpython on my HDD. How can I do that?


Solution

  • A simple answer is to use a screen capture tool, which most operating systems offer.

    As of this week (November 2018) there's a new option in GlowScript VPython, scene.capture(filename), which will also be available in the next release of VPython 7.

    Here's the documentation:

    capture(filename) Sends to your Download folder a png screen shot of the canvas. If filename is the string "boxes" or "boxes.png" the file will be named "boxes.png". (Not yet available in VPython 7.)