I am right now making a program that ask user to input the determinant of a matrix. at a first, a very complicate matrix will be generated, after two seconds, a new matrix will be generated.
Here is my code
#import part
import numpy
import scipy
import threading
from multiprocessing import pool
#defining part
def random_matrix(n):
array = numpy.random.random((n,n))
print array
def random_matrix_integer(n):
print "Sorry I was just joking, Please calculate this one."
array = numpy.random.random_integers(0,10,(n,n))
print array
#process part
print "Now,let's start a mathematical game."
random_matrix(3)
print "Please Tell me the dot product of this Matrix\n"
t =threading.Timer(2,random_matrix_integer(3))
t.start()
It works will until the timer part the "Please Tell me the dot product of this Matrix" will alert at the same time with the first matrix, and two seconds later. the console says
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 1082, in run
self.function(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
I would appreciate a lot if someone can help me with this easy problem