-
Notifications
You must be signed in to change notification settings - Fork 0
/
NC_Chat.py
56 lines (37 loc) · 1.29 KB
/
NC_Chat.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
from colorama import Fore
import time
class CHAT:
PINK='\033[35m'
HOST='localhost'
def Label():
os.system('clear')
os.system('figlet H Chat | lolcat')
print(Fore.RED+'\t'*4+'¥__1.0v__¥\n\n')
time.sleep(1)
def Choice():
print(Fore.YELLOW)
print('[1]Create Host')
print('[2]Join Host\n\n')
choice=int(input(Fore.GREEN+'Enter Choice>>> '+Fore.RED))
if choice==1:
CHAT.CHost()
elif choice==2:
CHAT.JHost()
else:
print('.....Invalied.....')
exit(0)
def JHost():
print(CHAT.PINK)
Host=input('~Enter connect wifi ip~ '+Fore.RED)
Port=int(input(CHAT.PINK+'~Enter Target Device Port~ '+Fore.RED))
print(Fore.GREEN+'\n<<<START Chating.....>>>\n'+Fore.RED)
time.sleep(1)
os.system(f'nc {CHAT.HOST} {Port}')
def CHost():
Port=int(input(CHAT.PINK+'\n~Enter 4 Number Port~ '+Fore.RED))
print(Fore.GREEN+'\n<<<START Chating..... >>>\n'+Fore.RED)
time.sleep(1)
os.system(f'nc -l -p {Port}')
CHAT.Label()
CHAT.Choice()