added
This commit is contained in:
13
Mittwoch/write_file.py
Normal file
13
Mittwoch/write_file.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
|
||||
def write_into_files(path, lines):
|
||||
with open(path, 'w') as outfile:
|
||||
for line in lines:
|
||||
print(line, file=outfile)
|
||||
pass
|
||||
|
||||
|
||||
lines = ["Das ist ein zeichen", "Das ist ein zweites zeichen0000"]
|
||||
lines.append("Next line")
|
||||
write_into_files("/tmp/test.txt", lines)
|
||||
Reference in New Issue
Block a user