Skip to content

Commit 5fc25c7

Browse files
committed
added transferring files
1 parent 828d927 commit 5fc25c7

File tree

6 files changed

+3412
-0
lines changed

6 files changed

+3412
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy
2424

2525
- ### [General Python Topics](https://www.thepythoncode.com/topic/general-python-topics)
2626
- [How to Make Facebook Messenger bot in Python](https://www.thepythoncode.com/article/make-bot-fbchat-python). ([code](general/messenger-bot))
27+
- [How to Transfer Files in the Network using Sockets in Python](https://www.thepythoncode.com/article/send-receive-files-using-sockets-python). ([code](general/transfer-files/))
2728

general/transfer-files/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# [How to Transfer Files in the Network using Sockets in Python](https://www.thepythoncode.com/article/send-receive-files-using-sockets-python)
2+
To run this:
3+
- `pip3 install -r requirements.txt`.
4+
- ### For the server ( the receiver ):
5+
-
6+
```
7+
python3 receiver.py
8+
```
9+
- ### For the client ( the sender ):
10+
-
11+
```
12+
C:\> python sender.py --help
13+
usage: sender.py [-h] [-p PORT] file host
14+
15+
Simple File Sender
16+
17+
positional arguments:
18+
file File name to send
19+
host The host/IP address of the receiver
20+
21+
optional arguments:
22+
-h, --help show this help message and exit
23+
-p PORT, --port PORT Port to use, default is 5001
24+
```
25+
For instance, if you want to send `data.csv` to `192.168.1.101`:
26+
```
27+
python3 sender.py data.csv 192.168.1.101
28+
```

0 commit comments

Comments
 (0)