import os
import json
import random
import time
mytime = time.localtime()
my_time = time.strftime("%B %d %Y %H:%M:%S", mytime)
###print(mytime)
myttime = []
for i in myttime:
print(i, end="")
myttimez = mytime[5]
myttimek = str(myttimez)
talking = [
"tell me a food you like eating",
"tell me a tvshow you like to watch",
"tell me a joke",
"tell me a poem",
"have you been having fun ",
"have you played any games lately",
]
print (random.choice(talking))
##print(mytime[5])
isxa = "is a"
quest = "?"
applex = "apple"
fruitx = "fruit"
foodx = "food"
tastex = "taste"
whatx = "what"
doesx = "does"
applesd = "apple"
yoou = "you"
az = "a"
xix = []
xitimeb = ["01", "02", "03"]
xitimec = ["01", "02", "03"]
xitimed = ["01", "02"]
tex = "axe"
thirtyer = []
sixtyer = []
tthirtyer = []
tstory = []
yesser = "yes"
x = []
a = 1
things = {'apple': {'name' : 'apple', 'living' : 'no', 'food' : 'yes', 'taste' : 'sweet'},
'lemon': {'name' : 'lemon', 'living' : 'no', 'food' : 'yes', 'taste' : 'bitter'},
'grape': {'name' : 'grape', 'living' : 'no', 'food' : 'yes', 'taste' : 'sweet'}}
things[4] = {'name' : 'carrot', 'living' : 'no', 'food' : 'yes', 'taste' : 'woody'}
###print(things[4])
del things[4]['taste']
del things['grape']['taste']
###print (things['grape'])
###print (things[4])
del things[4]
json_string = json.dumps(things)
###print(json_string)
hood = dict((new_val,new_k) for new_k,new_val in things['grape'].items()).get('yes')
###print("Dictionary search by value:",hood)
with open('names_of.json', 'w') as outfile:
json.dump(json_string, outfile)
with open('names_of.json') as file_object:
# store file data in object
data = json.load(file_object)
###print(data)
x = json.loads(data)
###print(x)
thinger = random.choice(list(x.items()))
###print('see it')
###print(thinger)
start_time = time.time()
my_dict = {}
b = ["/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "/"]
while True:
user = input('enter a word')
for i in myttime:
myitime = time.localtime()
myi_time = time.strftime("%B %d %Y %H:%M:%S", myitime)
###print(myitime[5])
viv = user.split()
coo = viv + b
tee = coo[0]
tex = coo[1]
tec = coo[2]
tep = coo[3]
tes = coo[4]
tet = coo[5]
###print(x)
if mytime.tm_hour < 6 or mytime.tm_hour > 17:
xix.append("keep sleeping in her bed")
print(xix)
break
elif isxa in user and foodx in user and applex in user and quest in user and yesser in (thirtyer and tstory) and yesser in (sixtyer and tstory):
print(x["apple"]["food"])
xix.clear()
elif whatx in user and doesx in user and tastex in user and applex in user and quest in user:
print("a apple taste's")
print(x['apple']["taste"])
xix.clear()
elif tex in x.keys():
print('it is there')
print(tex in x.keys())
xix.clear()
elif az in user and isxa in user:
my_dict.update({tex:tes})
print(my_dict)
xix.clear()
elif yesser in user:
print("yes")
elif yoou in user and quest in user:
print("i am fine")
else:
print("i am sorry i do not understand")
elapsed_time = time.time() - start_time
start_time = time.time()
mom = str(time.strftime("%M", time.gmtime(elapsed_time)))
print(mom)
def herresponse1():
print('what are you thinking about')
pass
def herresponse2():
print('are you bored of me')
pass
def herresponse3():
print('did you dose off?')
pass
what_she_says = [herresponse1,herresponse2,herresponse3]
she_says = random.choice(what_she_says)
if mom in (xitimeb and xitimec):
she_says = random.choice(what_she_says)
she_says()
print(she_says)
if mom in (xitimed and xitimec):
os.system("thingermy.py")
this chatbot says one of the follow. if you do not input