OSError: [Errno 2] ENOENT
Posted: Wed Aug 28, 2019 2:41 pm
Hi,
I am intending to convert the ascii.txt file into the hexadecimal and I used the following code (micropython) in Lopy4 which has ESP32;
import binascii
ascii = 'ascii.txt'
with open(ascii, 'rb') as f:
content = f.read()
data = binascii.hexlify(content)
print(data)
But I am getting the following error when I run the code
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
OSError: [Errno 2] ENOENT
>
Pycom MicroPython 1.18.2.r6 [v1.8.6-849-a210e85] on 2019-05-13; LoPy4 with ESP32
Type "help()" for more information.
>>>
However, when I run the above code in the Pycharm IDE, I did get the result as attached which I feel I got the result.
Can anyone help me what did I do wrong in the Lopy4 which has ESP32 using micropython and how do I rectify the error shown above please.
Thank you
I am intending to convert the ascii.txt file into the hexadecimal and I used the following code (micropython) in Lopy4 which has ESP32;
import binascii
ascii = 'ascii.txt'
with open(ascii, 'rb') as f:
content = f.read()
data = binascii.hexlify(content)
print(data)
But I am getting the following error when I run the code
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
OSError: [Errno 2] ENOENT
>
Pycom MicroPython 1.18.2.r6 [v1.8.6-849-a210e85] on 2019-05-13; LoPy4 with ESP32
Type "help()" for more information.
>>>
However, when I run the above code in the Pycharm IDE, I did get the result as attached which I feel I got the result.
Can anyone help me what did I do wrong in the Lopy4 which has ESP32 using micropython and how do I rectify the error shown above please.
Thank you