node.js - 使用 python 脚本调用 npx
问题描述
我想 使用 python 脚本
运行npx 命令行工具subprocess.Popen("npx chatito trainClimateBot.chatito",shell=True).wait()
,类似于:
但这不起作用并引发以下错误:,
==== CHATITO SYNTAX ERROR ====
Expected "#", "%", "//", "@[", "import ", "~", or end of line but end of input found.
Line: 1, Column: 1
==============================
FULL ERROR REPORT:
{ SyntaxError: Expected "#", "%", "//", "@[", "import ", "~", or end of line but end of input found.
at peg$buildStructuredError (.\.\.\npm-cache\_npx\10168\node_modules\chatito\parser\chatito.js:381:12)
at Object.peg$parse [as parse] ((.\.\.\npm-cache\_npx\10168\node_modules\chatito\parser\chatito.js:3563:11)
那么,有没有办法通过 python 脚本运行 npx 命令?
解决方案
推荐阅读
- r - 如何在蒙特卡洛模拟中添加均值和标准差线?
- protractor - Protractor 5.4.2 和 Webdriver 12.1.6 以及 chromedrivers 不支持 chrome 76
- amazon-web-services - 嵌套数组(属性)的分页
- javascript - 使用 GET 提交一些数据,一些使用 POST 提交到同一页面
- powershell - 使用 Authenticationn/Access Token 访问 TeamCity 会出现错误 401 Unauthorized
- intellij-idea - Intellij Idea 中“服务器问题”检查严重性的含义
- typescript - 如何在 TypeScript 中将字符串细化为“字符串枚举”?
- c# - 通过 api 控制器向用户发送主动消息
- css - 在悬停声明中引用父元素而不给它特定的名称
- c++ - 如何在线程中的循环中运行 QSoundEffect 或 QMediaPlayer?