Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # the line above needs to be at top of the python file, otherwise an error may result about encoding
- # string_true_if_all_in_Eng_context.py
- def isEnglish(s):
- try:
- s.decode('ascii')
- except UnicodeDecodeError:
- return 'F : '+s
- else:
- return 'T : '+s
- print isEnglish('slabiky, ale liší se podle významu')
- print isEnglish('This entire string is in English?')
- print isEnglish('ގެ ފުރަތަމަ ދެ އަކުރު ކަ')
- print isEnglish('how about this one : 通 asfަ')
- print isEnglish('123abc!@#$%^&*()[]{}=_-><.:\\/~+ ???')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement