Selective import

12 views
Skip to first unread message

Bruce Sherwood

unread,
May 27, 2017, 3:18:57 PM5/27/17
to Glowscript Users
Some aspects of the features described in the following instructions found on the first page of the Help at glowscript.org were broken and have probably been broken for several months but not noticed because they are rarely used. These features now work properly.

For experienced programmers


As a convenience to novice programmers to provide everything that is needed to get started, GlowScript VPython by default imports all of the VPython features and includes standard math functions such as sqrt. The documentation is written as though "from vpython import *" were present.


You can however import selectively, as shown in the following examples, which are compatible with Jupyter VPython. (To help with converting from Classic VPython, you can refer to "vis" or "visual" instead of "vpython".)


import vpython
import vpython as vp # "vp" is any name of your choice
from vypthon import box, color

Reply all
Reply to author
Forward
0 new messages