What does sys.stdin read?
问题 I get how to open files, and then use Python's pre built in functions with them. But how does sys.stdin work? for something in sys.stdin: some stuff here lines = sys.stdin.readlines() What's the difference between the above two different uses on sys.stdin? Where is it reading the information from? Is it via keyboard, or do we still have to provide a file? 回答1: So you have used Python's "pre built in functions", presumably like this: file_object = open('filename') for something in file_object: