Cor*_*man 3 python operators tetris
我正在尝试理解另一位作者在"NAND to Tetris"项目中编写Parser的代码,但是在使用这段代码中所示的"<>"运算符时却不明白它们的含义.我已经包含了他们的构造函数以供参考self.commands函数.
def __init__(self,fname):
self.fname = fname
self.commands = open(fname, 'r').readlines()
self.cleanUp()
.
.
.
def hasMoreCommands(self):
"""Return True if more commands to parse else return False"""
return self.commands <> [ ]
Run Code Online (Sandbox Code Playgroud)
在我看来,这是一种更简单的方法来确定代码中是否有更多行.那是对的吗?感谢您对此问题的任何意见!如果有更多信息可以帮助,请告诉我.