Python中常用到的两种标准化输入方式:分别sys.stdin和input,两者使用方式大致相同,但是总的来说sys.stdin使用方式更加多样化一些,下面就例子说明两者之间的使用差别。
1、input输入
input输入很简单,就是获得用户的输入,一般是在控制台界面。

运行之后就可以等待用户输入了,最终系统会认为回车键是输入的结束。
2、sys.stdin输入
第一他也可以实现和input一样的功能,比如

但是,他更常见的是另外一种使用方式,可以直接使用文件作为整体的输入,可以很简洁。

使用方法,将文件重定向到输入中去就可以很方便的使用。
