Python'da bi uygulama yapıyorum ve uygulamada csv dosyasındaki verilere göre tablo oluşturması gerekir. ama hep veri okumada bi problem çıkıyor.
Kod:
bu işlem için bu okuma doğru olur mu?
Kod:
Python:
def read_log_file(self):
if self.log_dosyasi:
try:
with open(self.log_dosyasi, 'r', encoding='utf-8', errors='replace') as file:
log_verileri = pd.read_csv(file, delimiter=',')
except pd.errors.ParserError as e:
self.show_alert("Hata", f"Log dosyası okunurken bir hata oluştu: {str(e)}")
return None
return log_verileri
else:
return None
def read_csv_file(self):
if self.csv_dosyasi:
try:
with open(self.csv_dosyasi, 'r', encoding='utf-8', errors='replace') as file:
ogrenci_bilgileri = pd.read_csv(file, delimiter=',')
except pd.errors.ParserError as e:
self.show_alert("Hata", f"Öğrenci dosyası okunurken bir hata oluştu: {str(e)}")
return None
return ogrenci_bilgileri
else:
return None
bu işlem için bu okuma doğru olur mu?