Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if an email is valid python

from validator_collection import checkers
# you might want to execute "pip install validator-collection" first

is_email_address = checkers.is_email('test@domain.dev')
# The value of is_email_address will now be True

is_email_address = checkers.is_email('this-is-an-invalid-email')
# The value of is_email_address will now be False

# Or if you want to pass in a variable
email = input('Please enter email: ').strip()
is_email_address = checkers.is_email(email)

# Or better yet
is_email_address = checkers.is_email(input('Please enter email: ').strip())
Source by pypi.org #
 
PREVIOUS NEXT
Tagged: #check #email #valid #python
ADD COMMENT
Topic
Name
7+2 =