-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpySeFi.py
More file actions
47 lines (39 loc) · 891 Bytes
/
pySeFi.py
File metadata and controls
47 lines (39 loc) · 891 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
|Python File Sender|
programa simple para enviar archivos
"""
import socket
import sys
import time
def banner():
ban=" ___ ___ ___ _ \n | _ \_ _/ __| ___| __(_)\n | _/ || \__ \/ -_) _|| |\n |_| \_, |___/\___|_| |_|\n |__/ "
return ban
def enviar(s, filename):
s.send(filename.encode())
time.sleep(1)
file = open(filename, 'rb')
while True:
strng = file.readline(512)
if not strng:
break
s.send(strng)
file.close()
print("archivo enviado con exito")
def main():
print(banner()+'\n\t\t\tby developmentMen\n')
s = socket.socket()
s.connect((sys.argv[1], 6333))
#try:
enviar(s, sys.argv[2])
#except :
#print("an error was ocurred")
#pass
s.close()
if __name__=='__main__':
try:
main()
except:
ModoDeUso = "uso: \t PySeFi [ip-server] [archivo]"
print (ModoDeUso)