输入完整命令行 [英] Full command line as it was typed

查看:224
本文介绍了输入完整命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在输入时获得完整的命令行。

I want to get the full command line as it was typed.

这:

.join(sys.argv [:])

在此处无效(删除双引号)。我也不喜欢重新加入被解析和分裂的东西。

doesn't work here (deletes double quotes). Also I prefer not to rejoin something that was parsed and splited.

任何想法?

提前谢谢。

推荐答案

。当输入的命令到达Python时,你的shell已经工作了它的魔力。例如,引用被消耗(如你所注意到的),变量被内插等。

You're too late. By the time that the typed command gets to Python your shell has already worked its magic. For example, quotes get consumed (as you've noticed), variables get interpolated, etc.

这篇关于输入完整命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆