Commit 0b8fe26e by Patryk Czarnik

zmiany we wczytywaniu c.d.

parent 409607e4
...@@ -18,12 +18,9 @@ class Employee: ...@@ -18,12 +18,9 @@ class Employee:
def read_csv(file_path='emps.csv'): def read_csv(file_path='emps.csv'):
emps = []
with open(file_path, mode='r', encoding='utf-8') as file: with open(file_path, mode='r', encoding='utf-8') as file:
file.readline() file.readline()
for line in file: return [Employee(*(line.strip().split(';'))) for line in file]
emps.append(Employee(*(line.strip().split(';'))))
return emps
def write_csv(emps, sciezka): def write_csv(emps, sciezka):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment