Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to check if user pressed enter in python

# 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")
Comment

PREVIOUS NEXT
Code Example
Python :: lineplot in plt 
Python :: use of self in pythonic class 
Python :: python string format_map 
Python :: eval() function in python 
Python :: python if elif else syntax 
Python :: python catching exceptions 
Python :: python xgboost 
Python :: rotatelist in python 
Python :: import turtle 
Python :: how to make a calcukatir un python 
Python :: dataframe cut 
Python :: email validation using django 
Python :: read header of csv file python 
Python :: use chrome console in selenium 
Python :: python quiz answer stores 
Python :: pythagore 
Python :: get ip python 
Python :: how to unstack multiindex pandas 
Python :: python dataframe limit rows 
Python :: time complexity of data structures in python 
Python :: python webscraper stack overflow 
Python :: pyhon 
Python :: remove percentage in python 
Python :: como agregar elementos a un array en python 
Python :: configure your keyboards 
Python :: how to use group by in python to get 15 mins candle data from 1 min candle 
Python :: roll a dice 
Shell :: uninstall libreoffice ubuntu 
Shell :: check supervisord status 
Shell :: check react version 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =