@coderash/

sandy

Python 2.7

No description

fork
loading
Files
  • main.py
  • about.txt
  • commands.txt
  • log.txt
  • notes.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import datetime

now = datetime.datetime.now()
now = now.strftime("%Y-%m-%d %H:%M")
print("Hello I'm Sandy, your virtual assistant")
f = open("about.txt", "r")
print(f.read())
print("Go on ask something, here are some instructions:")
f=open('commands.txt', 'r')
lines=f.readlines()
print(lines[0])
def run():
  command=input("Thing to do:")
  text=command
  text=now+" "+text+"\n"
  with open('log.txt', 'a') as the_file:
    the_file.write(text)
  def note():
    text=input("Text:")
    text=now+" "+text+"\n"
    with open('notes.txt', 'a') as the_file:
      the_file.write(text)
    run()
  if command ==("note please"):
    note()
    run()
  if command ==("exit"):
    exit()
  if command ==("read:log"):
    file = open('log.txt',mode='r')
 
# read all lines at once
    all_of_it = file.read()
 
# close the file
    file.close()
    run()
run()