commit message from python script

This commit is contained in:
2023-04-11 17:21:48 +02:00
parent 5eb0811319
commit c0ae9cc93d
184 changed files with 3725 additions and 31 deletions

View File

@@ -0,0 +1,17 @@
#! /usr/bin/env python3
def write_into_file(path, lines):
# Mode r=read, w=write, a=append
with open(path, 'w') as outfile:
# Python2.x: outfile.write(string + '\n')
# v2 und v3: outfile.writelines(map(lambda s: s+'\n', lines))
# outfile.writelines(f'{l}\n' for l in lines)
# outfile.writelines(l+'\n' for l in lines)
for line in lines:
print(line, file=outfile)
lines = []
lines.append("Das ist eine Zeile einfacher Text")
lines.append("Zur Sicherheit noch eine weitere Zeile")
write_into_file("/tmp/test.txt", lines)