본문 바로가기

python

[Python] VS Code에서 code 실행/debug 할 때 argument 입력

[실행 및 디버그] -> launch.json 에서 cofngurations > "args"에 List 형태로 argument 정보 입력.

 

<launch.json>

{
    // IntelliSense를 사용하여 가능한 특성에 대해 알아보세요.
    // 기존 특성에 대한 설명을 보려면 가리킵니다.
    // 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요.
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: 현재 파일",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            # custom arguments
            "args": [
            	"--config", "config_temp",
                "--random_seed", "42"
                ]
        }
    ]
}