Collect data in chunks from stdin: Python
问题 I have the following Python code where I collect data from standard input into a list and run syntaxnet on it. The data is in the form of json objects from which I will extract the text field and feed it to syntaxnet. data = [] for line in sys.stdin: data.append(line) run_syntaxnet(data) ##This is a function## I am doing this because I do not want Syntaxnet to run for every single tweet since it will take a very long time and hence decrease performance. Also, when I run this code on very