爱意满满的作品展示区。
formulahendry

在 vscode.dev 中直接运行 Python !纯浏览器环境,无后端

  •  5
     
  •   formulahendry ·
    formulahendry · Dec 5, 2021 · 12706 views
    This topic created in 1801 days ago, the information mentioned may be changed or developed.

    插件地址: https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner-for-web

    GitHub Repo: https://github.com/formulahendry/vscode-code-runner-for-web

    oBnP9H.png

    欢迎下载试用!

    • desktop 的 vs code 也能装。你本地没装 python 的话,也能直接运行 Python
    • vscode.dev 和 github.dev 也都支持!

    下一步:

    • 目前还支持标准的 Python 库,未来会支持更多 pip 包
    • 未来会看看对其他语言的支持
    Supplement 1  ·  Dec 5, 2021
    不知道是不是 vs code 插件市场的搜索有问题,直接搜 Code Runner for Web 搜不到。
    大家可以加个双引号来搜索:"Code Runner for Web"
    35 replies  •  2023-09-04 15:46:16 +08:00
    lopssh
    lopssh
    Dec 5, 2021
    1
    蟹蟹
    GlobalNPC
    GlobalNPC
    Dec 5, 2021 via iPhone
    2
    code runner 支持调试吗?
    flyflower
    flyflower
    Dec 5, 2021
    3
    你们都能用 github.dev 吗?我的 github.dev 一直卡在 “Setting up your web editor”😂
    cwr31
    cwr31
    Dec 5, 2021
    4
    @flyflower 一样
    cwr31
    cwr31
    Dec 5, 2021
    5
    @flyflower 刚试了一下可以了 wc
    ptwop
    ptwop
    Dec 5, 2021
    6
    @flyflower #3 我的也是 😂
    xe2vherd
    xe2vherd
    Dec 5, 2021 via iPhone
    7
    想知道原理是什么 js 实现的 python ?
    lmqdlr
    lmqdlr
    Dec 5, 2021 via Android
    8
    @zmxnv123 WebAssembly 吧,类似 pyodide
    ch2
    ch2
    Dec 5, 2021
    9
    文件路径是个什么逻辑?
    formulahendry
    formulahendry
    OP
    Dec 5, 2021
    10
    @zmxnv123 可以看这篇文章: https://zhuanlan.zhihu.com/p/441373442

    @lmqdlr 是的! Pyodide
    formulahendry
    formulahendry
    OP
    Dec 5, 2021
    11
    formulahendry
    formulahendry
    OP
    Dec 5, 2021
    12
    @infun 不支持哦~ 只能运行
    formulahendry
    formulahendry
    OP
    Dec 5, 2021
    13
    @ch2 文件系统似乎是虚拟的。
    Wataru
    Wataru
    Dec 5, 2021 via iPhone
    14
    感谢分享
    GlobalNPC
    GlobalNPC
    Dec 5, 2021 via iPhone
    15
    @formulahendry 非 web 版本有没有可能支持呢?
    formulahendry
    formulahendry
    OP
    Dec 5, 2021
    16
    @infun 桌面版的 VS Code 也能用的~
    GlobalNPC
    GlobalNPC
    Dec 5, 2021
    17
    @formulahendry 我在用 但是没有调试功能
    ch2
    ch2
    Dec 5, 2021
    18
    @formulahendry #13 不能读写 workspace 的文件就很没用
    iqoo
    iqoo
    Dec 5, 2021
    19
    WebAssembly 虽简单但体积很大性能也不高。还是期待直接翻译的版本。
    leoleoasd
    leoleoasd
    Dec 6, 2021
    20
    打个广告,在浏览器里直接运行 clang 编译器,编译 c++程序,并在浏览器里运行:
    https://github.com/eduoj/wasm-clang
    用法可参考
    https://github.com/EduOJ/frontend/blob/master/src/views/IDE.vue#L143-L180
    ptwop
    ptwop
    Dec 6, 2021
    21
    formulahendry
    formulahendry
    OP
    Dec 6, 2021
    22
    @ptwop 看看 console log 呢?
    浏览器和 os 是哪个?
    有没有科学上网~
    ptwop
    ptwop
    Dec 6, 2021
    23
    @formulahendry 浏览器是 Mac 上的 chrome ,代理用的 clash X ,打开一段时间之后就变成这样了😂 ![]( https://raw.githubusercontent.com/jhongyu/image/master/202112061250989.png)
    c1273082756
    c1273082756
    Dec 7, 2021
    24
    牛逼, 可以用, 就是支持的 pip 库有点少, 试了一下常用的比如 flask, numpy, requests, lxml 之类的库都是没办法 import 进来的, 希望这个插件能发展起来
    formulahendry
    formulahendry
    OP
    Dec 7, 2021
    25
    @c1273082756 嗯嗯,未来会调研下怎么添加其他库的支持~
    ClericPy
    ClericPy
    Dec 19, 2021
    26
    @ptwop
    @flyflower
    我也卡在这里, 然后 switchyomega 告诉我有个连接不通, 切换 pac 模式把 Azure 相关的一个域名加入白名单走梯子就通了...
    ptwop
    ptwop
    Dec 19, 2021
    27
    @ClericPy #26 刚刚试了一下可以了,多谢老哥
    yangtze
    yangtze
    Dec 20, 2021 via iPhone
    28
    能支持其他语言吗,比如 rust
    formulahendry
    formulahendry
    OP
    Dec 23, 2021❤️1
    29
    @yangtze 在计划中
    pocketz
    pocketz
    Dec 24, 2021
    30
    头像眼熟,一看名字是 code runner for web 就明白了
    yangheng4922
    yangheng4922
    Feb 14, 2022
    31
    flutter for web 能支持就好啦
    star7th
    star7th
    Jun 10, 2022
    32
    有实际应用场景吗?感觉没什么用。现代的项目都是各种依赖的,而你这个只支持标准库之类的,实际项目很难跑起来的,只能跑一些简单脚本。但如果是简单脚本,用 js 来写也不难
    stardust21
    stardust21
    Jun 10, 2022
    33
    @star7th 用来教学是不是可以,省去环境配置环节了
    bytesfold
    bytesfold
    Jun 10, 2022 via iPhone
    34
    可是跟 codespaces 有啥不同吗
    CodeCodeStudy
    CodeCodeStudy
    Sep 4, 2023
    35
    一直卡在 Initializing...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1565 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 16:30 · PVG 00:30 · LAX 08:30 · JFK 11:30
    ♥ Do have faith in what you're doing.