Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 C++ 中,我可以cin.ignore()在程序继续之前从用户那里获得击键。
cin.ignore()
cin.ignore()python中的等价物是什么?
你可以简单地做:
raw_input("Press enter to exit...") # use input() if using Python 3.x
但是,这仅适用于按Enter(用户可以输入一堆字母,但只能Enter在最后按)。