NameError: global name 'variable' is not defined python -
I am working on a project and displaying this error:
Class PRNG: def __init __ (self): # parameter # p-256 prime self.p = 115792089249357573530086143415290314195533631308867097853951 self.a = self.p-3 self.b = 41058363725152142129326129780047268409116419780047268409114441015993725554835256314039467401291 self. E = curve (own. A Self. B. Self-P) self.En = 115792089210356248762697446949407573529996955224135760342422259061068512044369 self.P = point (0,46263761741508638697010950048709651021688891777877937875096931459006746039284) self.k = 183521403747637560534595403690771364941493702673414885451510208165414833985 self.Q = mult (self.k, self.P, self E) self.t = bytes_to_int (os.urandom (32)) # initial seed # print self.tself.output_length = 240 self.truncate_length = 16 def function_attack (self, nbytes, predicted_state): call = ((nbytes * 8-1) / out.output_length) +1 out = '' in the xrange (call): tp = multi (predicted_state, self.P, self.E) s = tP.x sq = mult (s, self. Q, Self.E) r = sq.x R_out = r% (2 ** self. Output_lamp) self.t = s out = out + in T_to_bytes (r_out, self.output_length / 8) [: nbytes] def function (auto, nbytes): call = ((nbytes * 8-1) / out.output_length +1 out = '' for xrange (call) In: tP = mult (self.t, self.P, self.E) s = tP.x sq = mult (s), self. Q, self E) r = sq.x r_out = r% (2 ** self. Output_longham) self.t = s out = out + int_to_bytes (r_out, self output_lamb / 8) returns out [: nbytes] The first method is being called in a separate file and the output is always low (even if I change the local variable call ):
file "c: \ file1.py", line 32, & lt; Module & gt; Prng = PRNG () file "C: \ file_where_error_occurs.py", in line 286, __init__ in xrange (calls): name: error: global name 'call' is not defined What is doing?
You have indentation errors ... This is usually due to a combination of tabs and spaces ..The most civilian editor can fix this for you easily ... to view your indentation errors, run your program as your program
python -tt my_program.py
Comments
Post a Comment