-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsonEditorExample.py
More file actions
22 lines (15 loc) · 845 Bytes
/
jsonEditorExample.py
File metadata and controls
22 lines (15 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import fileManager
tList = ["hi", "hello", "hey", "sup", "good day", "greetings", "anyone here", "hallo"]
thList = ["Hello!", "Hey!", "Hi!", "Hey! What can I do for you?", "Howdy.", "Greetings.", "Hello."]
thiList = ["cya", "gtg", "goodbye", "Im leaving", "see you later", "see ya", "bye", "have a good day", "gotta go", "g2g"]
thisList = ["Bye!", "Sad to see you go :(", "Cya!", "Goodbye!", "Talk to you later!"]
editor = jsonEditor('./jsonExample.json', isAList=True)
editor.clear()
editor.start()
thisDict = editor.createJsonDict("Greeting", "Greeting section for chatbot", tList, thList)
testDict = editor.createJsonDict("Goodbye", "Goodbye section for chatbot", thiList, thisList, lastInAList=True)
editor.replace("lol", 1, 3, 5, 7, 9)
editor.write(thisDict)
editor.write(testDict)
editor.end()
#remove lastInList from createJsonDict