Is there any way to transfer files between computers using Python 3.6?
I want to transfer txt files between computers wihs are not on the same network.
Yes you can and if you know
socketyou could do it or use other libraries instead.
You would need to create a script that works as a server (once again
socketcan do it, or you could use the inbuilt library
http.serveror anything that allows you to make a server).
A simple server from the Python docs:
import http.server import socketserver PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print("serving at port", PORT) httpd.serve_forever()
Once your sever is working, you can add files to it to send you just need to receive it on the other pc this can be done effectively with
Also you need to find your ip address.
Here is a short demonstration on receiving information from a server:
Although you need to find your ip in this example it's
import urllib.request urllib.request.urlretrieve("192.168.0.6:8000", "filename.txt")
Obviously this is not complete these are the steps you need to perform in order to do what you are asking. Once you have a basic system going then you could focus on including a GUI or making it possible to send files both ways (this would just involve a script that allows both to serve and to receive.