Come per formare un dizionario di file e attributi in python

Esempi di codice

0
0

come fare un dict da un file py

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)

Pagine correlate

Pagine di esempio simili

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................