Hello World in VPython

April 23, 2008 at 8:05 pm (Uncategorized)

Since my video wasn’t very clear, here is the code for “Hello World in VPython”

from visual.text import *

# At present, VPython supports only numbers and uppercase characters. Other characters will be displayed as *

scene.title = “Hello World” #from the scene module it used the title function
# Here goes the hello world text
text(pos=(0,2,0), string=’PYTHON’, color=color.green, depth=0.3, justify=’center’)
text(pos=(0,4,0), string=’WELCOME TO THE WORLD OF’, color=color.orange, depth=0.3, justify=’center’)

# Pos means Position in xyz format

Hold right click to spin it, and hold both left and right click to zoom in and out.

Post a Comment