Skip to content

Instantly share code, notes, and snippets.

@avwhite
Created January 21, 2016 15:00
Show Gist options
  • Save avwhite/95a54d280c69ed5eda30 to your computer and use it in GitHub Desktop.
Save avwhite/95a54d280c69ed5eda30 to your computer and use it in GitHub Desktop.
Python script der loader data fra en csv fil
import csv
#Koden:
#
# with open("filenavn") as file:
# #kode der bruger filen her
#
#svare til at sige:
#
# file = open("filnavn")
# #kode der bruger filen her
#
#bortset fra at versionen med `with` automatisk sørger for at lukke filen
#ordenligt igen.
with open("zenbudata.csv", "r", newline='') as csvfile:
csv = csv.reader(csvfile)
for row in csv:
print(row[5])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment