Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
make pep8 happy
  • Loading branch information
DavidJacobson committed Jan 22, 2018
1 parent 9301561 commit c748168
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions safetext.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Inspiration https://www.zachaysan.com/writing/2017-12-30-zero-width-characters
# David Jacobson

import argparse,sys
import argparse
import sys
from characters_safetext import HOMOGLYPHS, ZERO_WIDTH_CHARS, NON_STANDARD_SPACES


Expand All @@ -15,15 +16,16 @@ def underline(chars):
return "'{}'".format(chars)
return '\033[4m' + chars + '\033[0m'


def safe_windows_print(s):
try:
print(s)
except UnicodeEncodeError as e:
for c in s:
try:
print(c, end = '')
print(c, end='')
except UnicodeEncodeError as d:
print('?', end = '')
print('?', end='')


# These are words that could fingerprint an author's location
Expand Down

0 comments on commit c748168

Please sign in to comment.