Commit a45286bb authored by xiezhi's avatar xiezhi

multi version support

parent 6696a919
{
"name": "Python 3.6 Development Environment",
"image": "hb.eazytec-cloud.com/eazytec/eazydevelop-base:ubuntu",
"features": {
"./python": {
"version": "3.6",
"installTools": true,
"toolsToInstall": "black,flake8,mypy,pytest,pylint"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.pytest-adapter",
"ms-python.vscode-pylance"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.configuration.updateBuildConfiguration": "automatic",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false
}
}
},
"postCreateCommand": "python --version && pip --version && python /workspaces/python/hello.py",
"remoteUser": "vscode"
}
{
"name": "Python 3.7 Development Environment",
"image": "hb.eazytec-cloud.com/eazytec/eazydevelop-base:ubuntu",
"features": {
"./python": {
"version": "3.7",
"installTools": true,
"toolsToInstall": "black,flake8,mypy,pytest,pylint"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.pytest-adapter",
"ms-python.vscode-pylance"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.configuration.updateBuildConfiguration": "automatic",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false
}
}
},
"postCreateCommand": "python --version && pip --version && python /workspaces/python/hello.py",
"remoteUser": "vscode"
}
{
"name": "Python 3.8 Development Environment",
"image": "hb.eazytec-cloud.com/eazytec/eazydevelop-base:ubuntu",
"features": {
"./python": {
"version": "3.8",
"installTools": true,
"toolsToInstall": "black,flake8,mypy,pytest,pylint"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.pytest-adapter",
"ms-python.vscode-pylance"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.configuration.updateBuildConfiguration": "automatic",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false
}
}
},
"postCreateCommand": "python --version && pip --version && python /workspaces/python/hello.py",
"remoteUser": "vscode"
}
{
"name": "Python Latest Development Environment",
"image": "hb.eazytec-cloud.com/eazytec/eazydevelop-base:ubuntu",
"features": {
"./python": {
"version": "latest",
"installTools": true,
"toolsToInstall": "black,flake8,mypy,pytest,pylint"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.pytest-adapter",
"ms-python.vscode-pylance"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.configuration.updateBuildConfiguration": "automatic",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false
}
}
},
"postCreateCommand": "python --version && pip --version && python /workspaces/python/hello.py",
"remoteUser": "vscode"
}
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
演示基本的Python语法和输出 演示基本的Python语法和输出
""" """
import sys
def main(): def main():
""" """
主函数:打印Hello World消息 主函数:打印Hello World消息
...@@ -14,7 +16,7 @@ def main(): ...@@ -14,7 +16,7 @@ def main():
# 演示一些基本的Python特性 # 演示一些基本的Python特性
name = "Python开发者" name = "Python开发者"
version = 3.11 version = f"{sys.version_info.major}.{sys.version_info.minor}"
print(f"你好,{name}!你正在使用Python {version}") print(f"你好,{name}!你正在使用Python {version}")
# 简单的数学运算 # 简单的数学运算
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment