【发布时间】:2016-03-12 19:19:07
【问题描述】:
我在将文本文件读入我的 python 程序时遇到问题。
import sys
words = sys.stdin.readlines()
我正在通过标准输入读取文件,但是当我尝试执行程序时出现此错误。
PS> python evil_61.py < evilwords.txt
At line:1 char:19
+ python evil_61.py < evilwords.txt
+ ~
The '<' operator is reserved for future use.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported
谁能告诉我如何运行这些类型的程序,因为它对我的课程至关重要,我宁愿使用 Windows 而不是 Linux。
【问题讨论】:
标签: python powershell