Hello to everyone!
I'm trying to create a code using Python but I have a problem.
It gives me this error:
Thank you very much
I'm trying to create a code using Python but I have a problem.
It gives me this error:
Error:File "/opt/miniconda3/bin/sfipick", line 268, in <module>
image = rsf2image(0)
File "/opt/miniconda3/bin/sfipick", line 67, in rsf2image
return img
UnboundLocalError: local variable 'img' referenced before assignment
I will post here the part of the code where the problem is:def rsf2image(i3): global byte ppm = '%s%d.ppm' % (name,i3) if not os.path.isfile(ppm): command = '< %s %s n3=1 f3=%d | %s %s | %s %s > %s' % \ (byte,sfwindow,i3,sfgrey,args,ppmpen,args,ppm) if os.system(command) or not os.path.isfile(ppm): sys.stderr.write('Failed to execute "%s"\n\n' % command) sys.exit(3) ppms.append(ppm) img = PhotoImage(file=ppm) return img ... image = rsf2image(0)Can someone please help me with this?
Thank you very much