From: Bruce S. <ba...@an...> - 2001-12-20 20:11:21
|
Another new experimental version of VPython for Windows Python 2.2 is available at vpython.org. This package contains new versions of a number of demo programs, to exploit the new mouse machinery. A significant change, soon to become standard, is that Visual no longer automatically imports the functions random, randint, and uniform from the whrandom module. This module has essentially been replaced by the random module. Rather than automatically import the newer random module, it seems prudent not to do this automatically. Some VPython users had already gotten caught by name conflicts due to this automatic import. If you do have a program that uses random functions, you can insert this line to obtain the old behavior: from random import random, randint, uniform Note however that randint is now officially "deprecated" in favor of a more Pythonish sequence-oriented randrange function. It is important that Visual automatically imports the standard math module, so that trig and other functions are always available to all VPython programs. But the number of programs that require random functions is relatively small. Bruce Sherwood |