简体   繁体   English

浏览器中的 Python 解释器。 在 Skulpt 中使用外部模块

[英]Python interpreter in browser. Using external modules in Skulpt

I can't import any modules into Sculpt.我无法将任何模块导入 Sculpt。 For example, I'm trying to add a numpy module:例如,我正在尝试添加一个 numpy 模块:

Sk.externalLibraries = {
    numpy: {
          path: 'https://raw.githubusercontent.com/waywaaard/skulpt_numpy/master/numpy/__init__.js'
    },
    'numpy.random': {
         path: 'https://raw.githubusercontent.com/waywaaard/skulpt_numpy/master/numpy/random/__init__.js'
    }
};

But when I type import numpy in the browser, sculpt writes: there is No module named numpy但是当我在浏览器中输入import numpy时, Sculp 写道: there is No module named numpy

I need to add several modules: numpy, matplotlib, scipy , and jcamp .我需要添加几个模块: numpy, matplotlib, scipyjcamp How can I do this?我怎样才能做到这一点?

Recently I've read, that Sk.externalLibraries are not supported more.最近我读到,不再支持 Sk.externalLibraries。 But I didn't found the replacement of this construction.但是我没有找到这个结构的替代品。 I don't know JS enough, but I need to add external libs in Sculpt.我不太了解 JS,但我需要在 Sculpt 中添加外部库。 Please, help!请帮忙!

'./numpy/__init__.js': {
      path: '/skulpt-numpy/dist/numpy/__init__.js'
},
'numpy.random': {
     path: '/skulpt-numpy/dist/numpy/random/__init__.js'
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM