.py
Windows bash コンソールを使用して、Visual Studio Code でpython ファイルを実行したいと考えています。
私がやろうとしたこと:
のデフォルト シェルを変更しますsettings.json
。
{
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
}
ファイル名を引数としてコマンドtasks.json
を実行するタスクを追加します。python
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "python",
"isShellCommand": true,
"showOutput": "always",
"tasks": [
{
"taskName": "Run python in bash",
"suppressTaskName": true,
"args": ["${file}"]
}
]
}
ここで解決すべき問題がいくつかあります。
- タスクが希望どおりに bash で実行されていない
C
ドライブにアクセスするには、ファイルパスで置き換える必要がありますC:\
/mnt/c
それらの問題に対する私の解決策を共有できますか?