Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
203 views
in Technique[技术] by (71.8m points)

How can I use a directory name with non-ASCII chars in VS Code and Python

I can not use Visual Studio Code app because when I write my codes and click to run button, I get an error. I think the error relevant with my computer user name which is not 'HUAWEI', but 'HUAWE?'. VS Code can't read the file name because of the '?' word. It read 'HUAWE?' as 'HUAWE', and here is my error:

PS C:UsersHUAWE?Desktoppython> & C:/Users/HUAWE/AppData/Local/Programs/Python/Python39/python.exe c:/Users/HUAWE/Desktop/python/Hello_World.py & : The term 'C:/Users/HUAWE/AppData/Local/Programs/Python/Python39/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Che ck the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:3

  • & C:/Users/HUAWE/AppData/Local/Programs/Python/Python39/python.exe c: ...
  • + CategoryInfo          : ObjectNotFound: (C:/Users/HUAWE/...on39/python.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To change the name of the file that you are editing. Follow the steps: 1.Right click on the file in the right side. 2.Look for an option called rename. 3.Click on rename and rename it and press enter.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...