뭐가 문제인거니/VSCode
[VSCode] 파이썬 ctrl+shift+B로 간단 실행 - Task Runner 설정
기록가
2021. 2. 21. 00:31
1. View > Command Palette... 혹은 Ctrl + Shift + P 로 Command Palette를 연다.
2. Command Palette에 Tasks:Configure Task를 검색, 클릭한다.
3. 클릭하면, Create tasks.json file from template가 뜨는데, 이를 클릭한다.
4. 어떤 json file을 만들지 선택하라는 건데 Others 를 선택한다.
5. 그럼 위와 같은 json file이 생성된다.
6. 위의 json file의 모든 내용을 지운다.
7. 그리고 내용을 아래의 코드로 채우고, 저장한다.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Project Label",
"type": "shell",
"command": "python",
"args": [
"${file}"
],
"presentation": {
"reveal": "always",
"panel": "new"
},
"options": {
"env": {
"PYTHONIOENCODING": "UTF-8"
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
8. 이제 Ctrl + Shift + B 로 간단하게 파이썬 실행이 가능해졌다.
콘솔창도 위와 같이 아주 깔끔해진 것을 볼 수 있다.