Code: Alles auswählen
import random
# importing pylab causes error, running python v2.5.2 or v2.6.4...
#from pylab import *
#
random.seed()
print "a random number below 11:", random.randint(0,11)
Code: Alles auswählen
import random
# importing pylab causes error, running python v2.5.2 or v2.6.4...
#from pylab import *
#
random.seed()
print "a random number below 11:", random.randint(0,11)
Code: Alles auswählen
In [47]: pylab.random
Out[47]: <built-in method random_sample of mtrand.RandomState object at 0xb7d3b380>
Code: Alles auswählen
File "C:\Documents and Settings\...\test_random.py", line 5, in <module>
random.seed()
AttributeError: 'builtin_function_or_method' object has no attribute 'seed'
Code: Alles auswählen
Code: Alles auswählen
from pylab import *
Code: Alles auswählen
import pylab
Code: Alles auswählen
plot([1,2,3])
Code: Alles auswählen
pylab.plot([1,2,3])
Code: Alles auswählen
# importing pylab causes error, running python v2.5.2 or v2.6.4...
#from pylab import *