Python

csv module (Python)

Në shqip: Moduli csv

ShpjegimiSQ

Moduli csv lexon dhe shkruan skedarë CSV — tabelat me presje që i hap edhe Excel-i. csv.DictReader e kthen çdo rresht në fjalor me emrat e kolonave.

EnglishEN

The csv module reads and writes CSV files — comma-separated tables that Excel can open too. csv.DictReader turns each row into a dictionary keyed by column names.

Si ta mendosh

Si ta lexosh një tabelë Excel rresht pas rreshti me kod.

Lexoje në anglisht

Like reading an Excel table row by row with code.

Shembull kodipython

import csv
with open("notat.csv", encoding="utf-8") as f:
    for rresht in csv.DictReader(f):
        print(rresht["emri"], rresht["nota"])

Terma të lidhur