Python 脚本没有从 vim 的 system() 接收参数
Python script doesn't receive arguments from vim's system()
我正在尝试根据 的建议翻译 vim 中的文本。但是,当我调用 system('ru2uk', getreg('"'))
(系统参数传输的参数)时,python 脚本没有收到 txt=' '.join(sys.argv[1:])
的参数。拼接有效,代码:system('ru2uk ' . getreg('"'))
来自: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()
的第二个参数不是“命令行参数”,而是标准输入数据。而且一定要好好对待。
我正在尝试根据 system('ru2uk', getreg('"'))
(系统参数传输的参数)时,python 脚本没有收到 txt=' '.join(sys.argv[1:])
的参数。拼接有效,代码:system('ru2uk ' . getreg('"'))
来自: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()
的第二个参数不是“命令行参数”,而是标准输入数据。而且一定要好好对待。