pythonwxpythonvpython

Program in wxPython and VPython


I wrote program in wxPython and VPython, but I have huge problem: Module VPython not always run. If I run program in Interpreter, program run more often , than after compilation. Code never returns any errors. I try on the other computers, program is the same.

Win7 Python 2.7.5 32bit wxPython 2.9.4 VPython 6.0.5

import visual as v
import wx

class Maintest(v.window):
    def InitUI(self):
        fileMenu = wx.Menu()


        self.menubar.Append(fileMenu, '&Plik')
        self.menubar.Remove(0)

    def asd(self, scene):
        v.box()


def main():
    w = Maintest(menus=True, title="program", x=100, y=100, width=1024, height=600)
    w.InitUI()
    scene = v.display(window=w, x=0, y=0, width=600, height=600,  up=(0,0,1), background=(1,1,1), foreground = (0,1,0), forward=(-1,-1,-1))
    w.asd(scene)
    while True:
        v.rate(60)

if __name__ == '__main__':
    main()

All is OK: http://imageshack.us/photo/my-images/199/tpp.png/ Not OK: http://imageshack.us/photo/my-images/689/akun.png/

It is only the part of main program, but problem is the same. What is wrong? What I should to do? I will be gratefull for answer.


Solution

  • With Win7 Python 2.7.5 64bit wxPython 2.9.4 VPython 6.0.5 I cannot get the program to fail. The fact that the problem is not entirely reproducible (and is entirely nonreproducible by me) suggests the possibility that the graphics driver needs to be updated. VPython uses the OpenGL 3D graphics library, which is sensitive to driver issues.