| 
 | 
 
 
发表于 2021-3-9 17:58:09
|
显示全部楼层
   本楼为最佳答案    
 
 
  安装插件 Code Runner 
修改python那一行的配置 否则会无法输出utf-8 
 
我的配置文件 
- {
 
 -     "python.defaultInterpreterPath": "C:\\Users\\kogawananari\\AppData\\Local\\Programs\\Python\\Python39\\python.exe",
 
 -     "python.formatting.provider": "yapf",
 
 -     "code-runner.clearPreviousOutput": true,
 
 -     //"code-runner.runInTerminal": true,
 
 -     //如果不开启 无法接受键盘输入
 
 -     //如果开启 下列命令里 标记“&&”需要改为使用分号“;”
 
 -     "code-runner.executorMap": {
 
 -         "javascript": "node",
 
 -         "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
 
 -         "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
 
 -         "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
 
 -         "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
 
 -         "php": "php",
 
 -         "python": "set PYTHONIOENCODING=utf8 && python",
 
 -         "perl": "perl",
 
 -         "perl6": "perl6",
 
 -         "ruby": "ruby",
 
 -         "go": "go run",
 
 -         "lua": "lua",
 
 -         "groovy": "groovy",
 
 -         "powershell": "powershell -ExecutionPolicy ByPass -File",
 
 -         "bat": "cmd /c",
 
 -         "shellscript": "bash",
 
 -         "fsharp": "fsi",
 
 -         "csharp": "scriptcs",
 
 -         "vbscript": "cscript //Nologo",
 
 -         "typescript": "ts-node",
 
 -         "coffeescript": "coffee",
 
 -         "scala": "scala",
 
 -         "swift": "swift",
 
 -         "julia": "julia",
 
 -         "crystal": "crystal",
 
 -         "ocaml": "ocaml",
 
 -         "r": "Rscript",
 
 -         "applescript": "osascript",
 
 -         "clojure": "lein exec",
 
 -         "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
 
 -         "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
 
 -         "racket": "racket",
 
 -         "scheme": "csi -script",
 
 -         "ahk": "autohotkey",
 
 -         "autoit": "autoit3",
 
 -         "dart": "dart",
 
 -         "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
 
 -         "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
 
 -         "haskell": "runhaskell",
 
 -         "nim": "nim compile --verbosity:0 --hints:off --run",
 
 -         "lisp": "sbcl --script",
 
 -         "kit": "kitc --run",
 
 -         "v": "v run",
 
 -         "sass": "sass --style expanded",
 
 -         "scss": "scss --style expanded",
 
 -         "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css"
 
 -     },
 
 - }
 
  复制代码 |   
 
 
 
 |