Python脚本不接收来自vim系统()的参数

2024-09-30 00:41:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图用vim和来自Replace visual selection的advision翻译文本。但当我调用system('ru2uk', getreg('"'))(通过系统参数传输的参数)时,python脚本不会通过txt=' '.join(sys.argv[1:])接收参数。串联工作,代码:system('ru2uk ' . getreg('"'))


Tags: 文本txt脚本参数系统vimsystemreplace
1条回答
网友
1楼 · 发布于 2024-09-30 00:41:37

:h system()

When {input} is given and is a string this string is written to a file and passed as stdin to the command.

所以system()的第二个参数不是“命令行参数”,而是stdin数据。而且必须妥善处理

相关问题 更多 >

    热门问题