Mac环境搭建
# 直接使用brew进行安装
brew install python3下载慢使用export ALL_PROXY=socks5://127.0.0.1:1086 && brew install python3
注意:代理端口号设置成自己的
廖雪峰:Python 安装
Homebrew macOS 缺失的软件包管理器
IDE开发工具
- 安装python扩展
- 安装完扩展,创建第一个py文件后,IDE会提示安装Pylint未安装,直接点
install即可 - 安装Code Runner 扩展
第一个Python程序
#!/usr/bin/env python3
print('Hello World')常见的问题
VS Code 配置使用Python3
打开首选项->设置 修改配置:
"python.pythonPath": "python3",Code Runner执行无法输出中文
类似这样的异常:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-14: ordinal not in range(128)
打开首选项->设置 修改配置:
"code-runner.runInTerminal": true如果没有在文件头部声明使用Python3,则需要修改vs code配置,将"code-runner.executorMap":中的"python": "python"改成"python": "python3"
评论列表(0条)