Python scripts will only work in pycharm

python 3.5 As you can see here: link This is what happens when I try to run ANY script on my computer that is not running inside pycharm. If I try to run the same code inside Pycharm, it works fine.

Here is the error code running in cmd:

python test.py

File "test.py", line 86 SyntaxError: non-UTF-8 code starting with '\ xf8' in the test.py file on line 86, but no declared encoding; see http://python.org/dev/peps/pep-0263/ for more details _______________________________ UPDATE ___________________________________

Okay, so I realized that it was because I had some kind of "non-English letter", for example; (æ, ø, å)

But the problem is that the script will look for the web element with the text: ““ Armbåndsure. ”And since it does not recognize the letter, how can I fix this error?

Here is my code:

 emner = browser.find_element_by_link_text('Armbåndsure og lommeure')

A code error of this line that I cannot get around, since it requires me to have "å" in my script:

  File "test.py", line 96
SyntaxError: Non-UTF-8 code starting with '\xe5' in file test.py on line 96, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
+4
source share
1 answer

, : " script ", . , UTF-8, script unicode , . , Python Unicode (python 2x, Python 3x).

, script PyCharm, , , .

, UTF-8 , . Python .

+1

Source: https://habr.com/ru/post/1661207/


All Articles