๐Ÿš€ VsCode์—์„œ python ์„ค์ •ํ•˜๊ธฐ!

๋ฏธ๋‹ˆยท2022๋…„ 6์›” 5์ผ

python

๋ชฉ๋ก ๋ณด๊ธฐ
1/1
post-thumbnail

vscode๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ํŒŒ์ด์ฌ์„ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์„ค์ •ํ•ด์•ผํ•  ๊ธฐ๋ณธ์ ์ธ ์‚ฌํ•ญ์ด๋‹ค!
์ดํ›„์— ๊ฐ€์ƒ ํ™˜๊ฒฝ ์„ค์ •์ด๋‚˜ ์ด๋Ÿฐ๊ฒƒ์€ ์ข€ ๋” ๊ณต๋ถ€ํ•  ์˜ˆ์ •....ใ…Žใ…Žใ…Žใ…Ž


01. python ํ™ˆํŽ˜์ด์ง€์—์Šค python ์„ค์น˜!

ํŒŒ์ด์ฌ ํ™ˆํŽ˜์ด์ง€ ( https://www.python.org/downloads/release/python-3104/ ) ์— ๋“ค์–ด๊ฐ€์„œ ๊ฐ์ž ์›ํ•˜๋Š” ๋ฒ„์ „๊ณผ ์‚ฌ์–‘์— ๋งž์ถฐ์„œ ๋‹ค์šด

02. vscode ์—์„œ Extension ์„ค์น˜

  • python [Microsoft๊ฒƒ์ธ์ง€ ํ™•์ธ!!!]
  • python Extension Pack : ํŒจํ‚ค์ง€๊ฐ€ ์—ฌ๋Ÿฌ๊ฐœ๋“ค์–ด ์žˆ๋‹ค!!

03. VsCode์—์„œ ์ž‘์—…ํ™˜๊ฒฝ ์„ค์ •ํ•˜๊ธฐ!

  1. ๋ช…๋ นํŒ”๋ ˆํŠธ cmd + shift + p ์‹คํ–‰ -> python interpreter ์‹คํ–‰
  1. ์›ํ•˜๋Š” ๋ฒ„์ „์˜ python์œผ๋กœ interpreter ์„ค์ •

    ๋‚˜๋ˆˆ 3.10.4 ๊น”์•˜์œผ๋‹ˆ๊นŒ ์ €๊ฒƒ์œผ๋กœ ์„ค์ •...!

  2. ์ƒˆ๋กœ์šด ํด๋” ์ƒ์„ฑํ›„ ๋””๋ฒ„๊ทธ ํƒญ์œผ๋กœ ๊ฐ€๋ฉด launch.json ์ƒ์„ฑ๊ฐ€๋Šฅ!!

  1. ๋ช…๋ นํŒ”๋ ˆํŠธ์—์„œ tasks configure ์ž…๋ ฅ => tasks.json์ƒ์„ฑ
  • tasks.json ์•„๋ž˜ ์ฝ”๋“œ๋กœ ์ˆ˜์ •
{
    // 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": "python3",
            "args": [
                "${file}"
            ],
            "presentation": {
                "reveal": "always",
                "panel": "new"
            },
            "options": {
                "env": {
                    "PYTHONIOENCODING": "UTF-8"
                }
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

-> "command": "python3", ๊ฐ€ ํ›„์— cmd + shift + b๋กœ ํŒŒ์ด์ฌ ์‹คํ–‰์‹œ ์˜ค๋ฅ˜ ์•ˆ๋‚˜์šฉ!

05. cmd+shift+b๋กœ ์‹คํ–‰!

์ง !

profile
ใ…‚r๋žŒใ„ธrใ„นr, ๆฐดใ„ธrใ„นr...๐ŸŒŠ

0๊ฐœ์˜ ๋Œ“๊ธ€