我想一次性在Python控制台中输入多个命令以进行测试。
例如:
userInput = None
while userInput != 'end':
userInput = input('$ ')
userInput = userInput.strip()
if userInput == 'one':
print('all')
elif userInput == 'two':
print('at')
elif userInput == 'three':
print('once')
有没有可能在输入“one”后,不再触摸键盘,然后输入“two”和“three”呢?
类似于:
one\rtwo\rthree\r
感谢您的帮助!