V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
formulahendry

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

  •  5
     
  •   formulahendry ·
    formulahendry · Dec 5, 2021 · 11911 views
    This topic created in 1604 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
        1
    lopssh  
       Dec 5, 2021
    蟹蟹
    GlobalNPC
        2
    GlobalNPC  
       Dec 5, 2021 via iPhone
    code runner 支持调试吗?
    flyflower
        3
    flyflower  
       Dec 5, 2021
    你们都能用 github.dev 吗?我的 github.dev 一直卡在 “Setting up your web editor”😂
    cwr31
        4
    cwr31  
       Dec 5, 2021
    @flyflower 一样
    cwr31
        5
    cwr31  
       Dec 5, 2021
    @flyflower 刚试了一下可以了 wc
    ptwop
        6
    ptwop  
       Dec 5, 2021
    @flyflower #3 我的也是 😂
    xe2vherd
        7
    xe2vherd  
       Dec 5, 2021 via iPhone
    想知道原理是什么 js 实现的 python ?
    lmqdlr
        8
    lmqdlr  
       Dec 5, 2021 via Android
    @zmxnv123 WebAssembly 吧,类似 pyodide
    ch2
        9
    ch2  
       Dec 5, 2021
    文件路径是个什么逻辑?
    formulahendry
        10
    formulahendry  
    OP
       Dec 5, 2021
    @zmxnv123 可以看这篇文章: https://zhuanlan.zhihu.com/p/441373442

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