#1
|
|||
|
|||
'int' object not callable
Quote:
These errors appear to be from inside the whrandom, what can I do? Last edited by enkeli; 05-12-2006 at 06:59 PM. |
#2
|
|||
|
|||
That module defines a class called whrandom. You must create an instance of the whrandom class, and then that instance can provide a stream of numbers. This works a bit differently from a simple function.
Code:
import whrandom rng = whrandom.whrandom() for loop in range(10): num = rng.randrange(1, 5) print num
__________________
-- [ e d h a l l e y ] I'm just a user, not a representative of WorldViz. Hope I've been helpful. |
#3
|
|||
|
|||
Thank you. I changed the whrandom, but I still get the same error from a different source (viz.py and vizmat.py and vizact.py)
Quote:
Last edited by enkeli; 05-15-2006 at 04:48 PM. |
#4
|
|||
|
|||
I just got an error even with the whrandom change...
Code:
rand = whrandom.whrandom() Quote:
|
#5
|
|||
|
|||
The “TypeError: 'int' object is not callable” error message indicates that python expected a function in the place of an int object type. Perhaps there is a variable named int like in the following code.
Code:
import viz viz.go() int = 4 print int(1.1) |
#6
|
|||
|
|||
In my code, there are no variables named "int"
|
#7
|
|||
|
|||
Guess I am a little stumped without your complete code context. I suggest that you focus your debuging on the fact that you are getting a Type Error. You could also try utilizing the newer ‘random’ module instead of whrandom.
|
#8
|
|||
|
|||
Thank you for responding. The trouble with debugging is the fact that this is an intermittent problem which does not occur every time the code is run. And as in one of the earlier posts, the 'int' object not callable error occurs with other modules than just the whrandom.
|
#9
|
|||
|
|||
I had the same problem. My mistake was to have declared use the name "range" as a variable before I called the function range(10).
|
|
|