-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
28 lines (22 loc) · 784 Bytes
/
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
from Message import Message
name = raw_input('Enter name: ')
while True:
command = raw_input('Enter command: ')
if command == 'chat':
for msg in Message.select():
print msg
elif command == 'message' or command == 'msg':
Message.create(name=name,
text_message=raw_input('Enter message: '))
elif command == 'rename':
name = raw_input('Enter name: ')
elif command == 'help':
print 'Commands: "chat" - View chat! ' \
'"msg or message" - Send message! ' \
'"rename" - change name ' \
'"Exit or exit" - exit application'
elif command == 'Exit' or command == 'exit':
print 'goodbye'
break
else:
print 'command not found!'