Upgraded autoinstallation of modules
This commit is contained in:
parent
1b94eeb118
commit
89e4d039bb
|
@ -1,12 +1,12 @@
|
||||||
from socket import socket, AF_INET, SOCK_STREAM
|
from socket import socket, AF_INET, SOCK_STREAM
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from subprocess import run
|
from subprocess import check_call
|
||||||
from sys import argv
|
from sys import argv, executable
|
||||||
try:
|
try:
|
||||||
from cryptography.fernet import Fernet
|
from cryptography.fernet import Fernet
|
||||||
except:
|
except:
|
||||||
run("python3 -m pip install cryptography")
|
check_call((executable, '-m', 'pip', 'install', 'cryptography'))
|
||||||
from cryptography.fernet import Fernet
|
from cryptography.fernet import Fernet
|
||||||
|
|
||||||
class client():
|
class client():
|
||||||
|
@ -41,6 +41,6 @@ class client():
|
||||||
self.sMsg(msg)
|
self.sMsg(msg)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run("clear")
|
check_call('clear')
|
||||||
Client = client()
|
Client = client()
|
||||||
Client.chat()
|
Client.chat()
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
from socket import socket, AF_INET, SOCK_STREAM
|
from socket import socket, AF_INET, SOCK_STREAM
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from subprocess import run
|
from subprocess import check_call
|
||||||
from sys import argv
|
from sys import argv
|
||||||
try:
|
try:
|
||||||
from cryptography.fernet import Fernet
|
from cryptography.fernet import Fernet
|
||||||
except:
|
except:
|
||||||
run("python3 -m pip install cryptography")
|
check_call((executable, '-m', 'pip', 'install', 'cryptography'))
|
||||||
from cryptography.fernet import Fernet
|
from cryptography.fernet import Fernet
|
||||||
|
|
||||||
class Server:
|
class Server:
|
||||||
|
@ -40,7 +40,7 @@ class Server:
|
||||||
self.client.send(self.f.encrypt(msg.encode()))
|
self.client.send(self.f.encrypt(msg.encode()))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run("clear")
|
check_call('clear')
|
||||||
Server_m = Server()
|
Server_m = Server()
|
||||||
Server_m.chat()
|
Server_m.chat()
|
||||||
Server_m.receiving.join()
|
Server_m.receiving.join()
|
||||||
|
|
Loading…
Reference in New Issue