This doesn't produce a window and I don't know why
<p>I am using VPython in my attempt to model a ball bouncing off a wall. </p>

<p>To make my code more elegant, I have decided to use class inheritance to set the dimensions and properties of my objects (at the moment, it's the ball and a wall). After I ran the code, the shell didn't produce any errors, however, it did not produce a window either. </p>

<p>I am fairly new to programming and I am using VPython 2.7 in Wine on Linux Mint 18. I have a feeling that I have missed something obvious but I don't know what it is. </p>

<p>My code so far is as follows:</p>

<pre><code>from visual import *

class Obj(object):

def __init__(self, pos, color): #sets the position and color
         self.pos = pos
         self.color = color

class Sphere(Obj):

    def __init__(self, pos, color, radius):
        super(Sphere, self).__init__(pos, color)
        self.radius = radius

class Box(Obj):

    def __init__self, pos, color, radius):
        super(Box, self).__init__(pos, color)
        self.size = size
        self.opacity = opacity


ball1 = Sphere((-5,0,0,), color.orange, 0.25)
wallR = Box((6,0,0), color.cyan, (0.,12,12), 0.3)
</code></pre>

<p>I take it you never dealt with graphic aspects before, as there is nothing about it in the code you posted. Then it is time to begin !
By default, python works in console mode. To show an actual window, with icons and stuff going across it, you'll need to write it explicitly in your code, using modules like <strong>TKinter</strong> or <strong>pygame</strong>.</p>

<p>I suggest you read the tutorial I found here : <a href="http://code.activestate.com/recipes/502241-bouncing-ball-simulation/" rel="nofollow">http://code.activestate.com/recipes/502241-bouncing-ball-simulation/</a> as it does what you want (with <strong>TKinter</strong>), including the window part. Take a look at it and let's see if you still need help !</p>

python python-2.7 vpython