commit message from python script
This commit is contained in:
21
meine_test/shelve_test.py
Executable file
21
meine_test/shelve_test.py
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import shelve
|
||||
# schreibe shelve Wird dauerhaft gespeichert
|
||||
spieler_endrunde = ["Hans", "Daniel"]
|
||||
with shelve.open("testfile") as inhalt:
|
||||
inhalt["imFinale"] = spieler_endrunde
|
||||
# inhalt["Vorrunde"] = [spieler_endrunde, "Klaus", "Martin"]
|
||||
#
|
||||
#with shelve.open("testfile") as inhalt:
|
||||
# print(inhalt["imFinale"])
|
||||
# erweitere Shelve mit neuer Liste
|
||||
with shelve.open("testfile") as inhalt:
|
||||
new_value = inhalt["imFinale"]
|
||||
new_value.append("derNeue3")
|
||||
#inhalt["imFinale"] = new_value
|
||||
print(list(inhalt.keys()))
|
||||
|
||||
|
||||
#with*1 open('Textdatei.txt', 'w') as inhalt*2:
|
||||
#*3inhalt.write('Hallo Schrödinger!')
|
||||
Reference in New Issue
Block a user