Print label in ascii pritn

This commit is contained in:
Lukáš Plevač 2023-11-15 19:30:55 +01:00
parent ee8ae8797c
commit 7dd7b3ed6e
2 changed files with 17 additions and 7 deletions

View File

@ -99,4 +99,14 @@ def showMolecule(molecule, spacing = ""):
Invlines[2] += " " Invlines[2] += " "
for line in reversed(Invlines): for line in reversed(Invlines):
print(spacing.join(line)) print(spacing.join(line))
# print bases in bottom
label = []
for i in range(len(molecule)):
if (molecule.getBase(0, i) != nothing):
label.append(molecule.getBase(0, i) + spacing)
else:
label.append(" " + spacing)
print("".join(label))

View File

@ -146,35 +146,35 @@ myreg.inscription([
molecule.parse("{D*E*A*F*}") molecule.parse("{D*E*A*F*}")
]) ])
myreg.asciiShow("") myreg.asciiShow(" ")
myreg.inscription([ myreg.inscription([
molecule.parse("{D*E*A*B*C*G*}") molecule.parse("{D*E*A*B*C*G*}")
]) ])
myreg.asciiShow("") myreg.asciiShow(" ")
myreg.inscription([ myreg.inscription([
molecule.parse("{DEABCG}") molecule.parse("{DEABCG}")
]) ])
myreg.asciiShow("") myreg.asciiShow(" ")
myreg.inscription([ myreg.inscription([
molecule.parse("{A*B*C*}"), molecule.parse("{A*B*C*}"),
molecule.parse("{D*E*}") molecule.parse("{D*E*}")
]) ])
myreg.asciiShow("") myreg.asciiShow(" ")
myreg.inscription([ myreg.inscription([
molecule.parse("{DEAF}") molecule.parse("{DEAF}")
]) ])
myreg.asciiShow("") myreg.asciiShow(" ")
myreg.inscription([ myreg.inscription([
molecule.parse("{B*C*D*E*}") molecule.parse("{B*C*D*E*}")
]) ])
myreg.asciiShow("") myreg.asciiShow(" ")