This article uses Python3.
test.py
import re
text = '''For those who have never experienced setbacks,
A It means that I have never tried anything new.
ヲ abc123!=*Z
-Albert Einstein-'''
after = re.sub('[^!-~\\s]|[ ]', '○', text)
print (after)
○○○○○○○○○○○○○○
○○○○○○○○0 1○○○○○○○○○○○○○○○○
○abc123!=*○
-○○○○○○○○○○○○○○○○-
Recommended Posts