327 lines
4 KiB
Python
Executable file
327 lines
4 KiB
Python
Executable file
#!/usr/bin/python3
|
|
|
|
alphabet = "abcdefghijklmnopqrstuvwxyzäöüß ?!.1234567890"
|
|
buchstaben = [
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
"##### ",
|
|
"# # ",
|
|
"# # ",],
|
|
[
|
|
"#### ",
|
|
"# # ",
|
|
"#### ",
|
|
"# # ",
|
|
"#### ",],
|
|
[
|
|
"##### ",
|
|
"# ",
|
|
"# ",
|
|
"# ",
|
|
"##### ",],
|
|
[
|
|
"#### ",
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",
|
|
"#### ",],
|
|
[
|
|
"##### ",
|
|
"# ",
|
|
"### ",
|
|
"# ",
|
|
"##### ",],
|
|
[
|
|
"##### ",
|
|
"# ",
|
|
"### ",
|
|
"# ",
|
|
"# ",],
|
|
[
|
|
" ### ",
|
|
"# ",
|
|
"# ## ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"# # ",
|
|
"# # ",
|
|
"##### ",
|
|
"# # ",
|
|
"# # ",],
|
|
[
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
" # ",],
|
|
[
|
|
" ### ",
|
|
" # ",
|
|
" # ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"# # ",
|
|
"# # ",
|
|
"## ",
|
|
"# # ",
|
|
"# # ",],
|
|
[
|
|
"# ",
|
|
"# ",
|
|
"# ",
|
|
"# ",
|
|
"##### ",],
|
|
[
|
|
"# # ",
|
|
"## ## ",
|
|
"# # # ",
|
|
"# # ",
|
|
"# # ",],
|
|
[
|
|
"# # ",
|
|
"## # ",
|
|
"# # # ",
|
|
"# ## ",
|
|
"# # ",],
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"#### ",
|
|
"# # ",
|
|
"#### ",
|
|
"# ",
|
|
"# ",],
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
"# # ",
|
|
"# ## ",
|
|
" #### ",],
|
|
[
|
|
"#### ",
|
|
"# # ",
|
|
"#### ",
|
|
"# # ",
|
|
"# # ",],
|
|
[
|
|
" ### ",
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
"### ",],
|
|
[
|
|
"##### ",
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
" # ",],
|
|
[
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"# # ",
|
|
"# # ",
|
|
" # # ",
|
|
" # # ",
|
|
" # ",],
|
|
[
|
|
"# # # ",
|
|
"# # # ",
|
|
"# # # ",
|
|
"##### ",
|
|
" # # ",],
|
|
[
|
|
"# # ",
|
|
" # # ",
|
|
" # ",
|
|
" # # ",
|
|
"# # ",],
|
|
[
|
|
"# # ",
|
|
"# # ",
|
|
" # # ",
|
|
" # ",
|
|
" # ",],
|
|
[
|
|
"##### ",
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
"##### ",],
|
|
[
|
|
"# # ",
|
|
" # ",
|
|
" # # ",
|
|
"##### ",
|
|
"# # ",],
|
|
[
|
|
"# # ",
|
|
" ### ",
|
|
"# # ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"# # ",
|
|
" ",
|
|
"# # ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"### ",
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",],
|
|
[
|
|
" ",
|
|
" ",
|
|
" ",
|
|
" ",
|
|
" ",],
|
|
[
|
|
" ## ",
|
|
" # ",
|
|
" ## ",
|
|
" ",
|
|
" # ",],
|
|
[
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
" ",
|
|
" # ",],
|
|
[
|
|
" ",
|
|
" ",
|
|
" ",
|
|
" ",
|
|
" # ",],
|
|
[
|
|
" # ",
|
|
" ## ",
|
|
" # ",
|
|
" # ",
|
|
" ### ",],
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
" ## ",
|
|
" # ",
|
|
"##### ",],
|
|
[
|
|
"#### ",
|
|
" # ",
|
|
" ### ",
|
|
" # ",
|
|
"#### ",],
|
|
[
|
|
" # ",
|
|
" ## ",
|
|
" # # ",
|
|
"##### ",
|
|
" # ",],
|
|
[
|
|
"#### ",
|
|
"# ",
|
|
"#### ",
|
|
" # ",
|
|
" ### ",],
|
|
[
|
|
" # ",
|
|
" # ",
|
|
" ### ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
"##### ",
|
|
" # ",
|
|
" # ",
|
|
" # ",
|
|
"# ",],
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
" ### ",
|
|
"# # ",
|
|
" ### ",],
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
" #### ",
|
|
" # ",
|
|
" ## ",],
|
|
[
|
|
" ### ",
|
|
"# # ",
|
|
"# # ",
|
|
"# # ",
|
|
" ### ",],]
|
|
|
|
|
|
def ersetzen(text, zu_ersetzen):
|
|
out = ""
|
|
zahler = 0
|
|
while text.count("#") >= len(zu_ersetzen) :
|
|
zu_ersetzen += zu_ersetzen
|
|
for zeichen in text:
|
|
if zeichen == " ":
|
|
out += " "
|
|
elif zeichen == "#":
|
|
out += zu_ersetzen[zahler]
|
|
zahler += 1
|
|
else:
|
|
out += zeichen
|
|
return out
|
|
|
|
def mache_Buchstaben(inp, x_size: int=1, y_size: int=1):
|
|
out = ""
|
|
|
|
for zähler in range(0,5) : #schichten auftragen
|
|
line = ""
|
|
|
|
for z in range(0,len(inp)) : # für einzelne buchstaben schichten auftragen
|
|
gerade_b_buchstabe = inp[z]
|
|
|
|
gnumpf = buchstaben[gerade_b_buchstabe][zähler]
|
|
|
|
for char in gnumpf:
|
|
line += char * x_size
|
|
|
|
out += (line + "\n") * y_size
|
|
|
|
return out
|
|
|
|
def to_nummern(inp):
|
|
nummern_list = []
|
|
for a in inp :
|
|
for b in range(len(alphabet)):
|
|
if a == alphabet[b]:
|
|
nummern_list.append(b)
|
|
return nummern_list
|
|
|
|
def ascii_maker(text, replace=""):
|
|
ascii_umgewandelt = mache_Buchstaben(to_nummern(text))
|
|
|
|
if replace == "":
|
|
return ascii_umgewandelt
|
|
|
|
else:
|
|
return ersetzen(ascii_umgewandelt, replace)
|
|
|
|
if __name__ == "__main__":
|
|
print("Willkommen bitte alles kleinschreiben(Hinweis:beim erstellen der ASCII Schrift sind nur diese Zeichen erlaubt:)",alphabet)
|
|
|
|
ascii_umgewandelt = mache_Buchstaben(to_nummern(input("Text: ").casefold()))
|
|
print(ascii_umgewandelt)
|
|
print(ersetzen(ascii_umgewandelt,input("Zu ersetzen: ")))
|
|
|