aboutsummaryrefslogtreecommitdiff
path: root/Info
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-12-14 16:31:53 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2024-12-14 16:31:53 +0100
commitff87e8c2b6e48590274c6386f229fa2bf9a248a8 (patch)
treefdba6ec73ed0f088991075ca89b1462d860871c1 /Info
parenteab98cf90c92222efb9ed05f1e665eb6614f78f8 (diff)
downloadunterricht-ff87e8c2b6e48590274c6386f229fa2bf9a248a8.tar.gz
unterricht-ff87e8c2b6e48590274c6386f229fa2bf9a248a8.zip
improve code style
Diffstat (limited to 'Info')
-rwxr-xr-xInfo/Binaersystem/gen_cards.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Info/Binaersystem/gen_cards.py b/Info/Binaersystem/gen_cards.py
index e8fd58ed..01091c1c 100755
--- a/Info/Binaersystem/gen_cards.py
+++ b/Info/Binaersystem/gen_cards.py
@@ -10,9 +10,10 @@ def gen_numbers(end_pos=7, end_number=80) -> list[list[int]]:
ns.append(n)
return ns
+
def main():
all = gen_numbers()
- with open(f'cards.tex', 'w', encoding='utf-8') as card:
+ with open('cards.tex', 'w', encoding='utf-8') as card:
print(r'\documentclass[landscape]{article}', file=card)
print(r'\usepackage[margin=2cm]{geometry}', file=card)
print(r'\setlength\parindent{0pt}', file=card)
@@ -23,14 +24,15 @@ def main():
print(r'\begin{document}', file=card)
print(r'\pagestyle{empty}', file=card)
for i, ns in enumerate(all):
- print(r'\begin{tikzpicture}', file=card)
- s = ''
- for n in ns:
- s += f'{n} '
- print(r'\node[card]', file=card)
- print(rf' {{\begin{{varwidth}}{{9cm}}\huge {s}\end{{varwidth}}}};', file=card)
- print(r'\end{tikzpicture}', file=card)
+ print(r'\begin{tikzpicture}', file=card)
+ s = ''
+ for n in ns:
+ s += f'{n} '
+ print(r'\node[card]', file=card)
+ print(rf' {{\begin{{varwidth}}{{9cm}}\huge {s}\end{{varwidth}}}};', file=card)
+ print(r'\end{tikzpicture}', file=card)
print(r'\end{document}', file=card)
+
if __name__ == '__main__':
main()