Python Forum
[Errno 22] Invalid argument - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: [Errno 22] Invalid argument (/thread-5293.html)

Pages: 1 2


RE: [Errno 22] Invalid argument - lichunming - Jul-14-2020

(Feb-11-2020, 03:01 PM)snippsat Wrote: Look like your editor have introduced a non-printing character U-202A is LEFT-TO-RIGHT EMBEDDING.
It's there even if you can not see it,this is a copy of code from your post.
>>> s = r'‪C:\Users\Eli T\Desktop\ENSO.xlsx'
>>> s
'\u202aC:\\Users\\Eli T\\Desktop\\ENSO.xlsx'
A temp fix could be this,you should investigate editor,eg try and other and see if it's happen there to.
>>> s = r'‪C:\Users\Eli T\Desktop\ENSO.xlsx'
>>> s
'\u202aC:\\Users\\Eli T\\Desktop\\ENSO.xlsx'
>>> 
>>> s = s.lstrip('\u202a')
>>> s
'C:\\Users\\Eli T\\Desktop\\ENSO.xlsx'
>>> enso = pd.read_excel(s, 'r')
hi, in Spyder, by default, how to remove '\u202a'? Thank you


RE: [Errno 22] Invalid argument - lichunming - Jul-14-2020

Jupyter does not have this error: \u202a
How to configure Spyder IDE to rectify it? Thank you