从 STDIN 中读取文本 Python

Read in text from STDIN Python

我想知道如何从 STDIN 读取它并将其存储到两个数字变量中。谢谢

10
20

-瑞克

在python2.7+:

x=int(raw_input()) #Terminal will stall to allow user to input the first number
y=int(raw_input()) #This will wait for the second number to be inputted

在python3中:

x=int(input()) #Terminal will stall to allow user to input the first number
y=int(input()) #This will wait for the second number to be inputted