📌  相关文章
📜  如何检查用户是否在python代码示例中按下回车键

📅  最后修改于: 2022-03-11 14:45:20.027000             🧑  作者: Mango

代码示例1
# credit to the Stack Overflow user in source link

text = input("type in enter")  # or raw_input in python2
if text == "":
    print("you pressed enter")
else:
    print("you typed some text before pressing enter")