Python'da dosya ve özniteliklerin sözlüğü nasıl oluşturulur
Kod örnekleri
0
0
py dosyasından bir dict nasıl yapılır
dictionary = {}
file = open("data.txt")
for line in file:
key, value = line. split() # Split line into a tuple.
dictionary[key] = value # Add tuple values to dictionary.
print(dictionary)