#에러 전문
>>> set PYTHONIOENCODING=utf8 ; if ($?) { py } "d:\dev\Repositiory\Python-prac\py_basic\prac3.py" File "<stdin>", line 1 set PYTHONIOENCODING=utf8 ; if ($?) { py } "d:\dev\Repositiory\Python-prac\py_basic\prac3.py" ^ SyntaxError: invalid syntax
# 해결법
code-runner 실행 설정에서
"code-runner.executorMap": {
"python": "set PYTHONIOENCODING=utf8 | py"
}
파이썬 항목을 이렇게 바꿔주면 된다.
# 에러 발생이유
이미 실행되어있는 파이썬 인터프리터 내부에서 파이썬을 다시 실행해서 생기는 오류.
파이썬 인터프리터에서는 입력커서 앞부분이 >>>으로 바뀐다.
# 참조 링크
stackoverflow.com/questions/13961140/syntax-error-when-using-command-line-in-python
syntax error when using command line in python
I am a beginner to python and am at the moment having trouble using the command line. I have a script test.py (which only contains print("Hello.")), and it is located in the map C:\Python27. In my ...
stackoverflow.com
[ vscode ] extension "Code Runner" 한글 깨짐 (python, c, cpp)
1. Code Runner 설정으로 들어간다. 2. setting.json 열기 # python 항목 수정 "python": "python -u", 를 아래와 같이 수정 "python": "set PYTHONIOENCODING=utf8 && python -u", # C, Cpp 항목 수정 "c": "..
urakasumi.tistory.com