1 Star 0 Fork 0

joyni/vscode-python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pyvsc-run-isolated.py 685 Bytes
一键复制 编辑 原始数据 按行查看 历史
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
if __name__ != "__main__":
raise Exception("{} cannot be imported".format(__name__))
import runpy
import sys
# We "isolate" the script/module (sys.argv[1]) by
# deleting sys.path[0] and then sending the target
# on to runpy.
del sys.path[0]
del sys.argv[0]
module = sys.argv[0]
if module == "-c":
ns = {}
for code in sys.argv[1:]:
exec(code, ns, ns)
elif module.startswith("-"):
raise NotImplementedError(sys.argv)
elif module.endswith(".py"):
runpy.run_path(module, run_name="__main__")
else:
runpy.run_module(module, run_name="__main__", alter_sys=True)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luluunusually/vscode-python.git
git@gitee.com:luluunusually/vscode-python.git
luluunusually
vscode-python
vscode-python
master

搜索帮助