My program is in .net framework which reads python script and tries to execute it using IronPython packages. In the python script, we are importing python modules (can be any python module). While execution, I am getting an error ‘module [modulename] not found’. I tried copying the module from my python installation directory to solution directory, then it seems it found the module but giving me an exception. Below are the script and error
import random
random_number = random.randint(1, 100)
print(str(random_number))
sequence item 0: expected bytes or byte array, str found
I found a suggestion for the error to convert the result to bytes like in the attached screenshot.
But that also didn’t work when I ran the script in my program
Please help me with this issue.
sample that script works
I tried updating the script response to send a byte instead of str as I was getting this exception
sequence item 0: expected bytes or byte array, str found
95m_abs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.