For ease of debugging it might be easier to first make sure that the server works, before you start on the client. Other than that:
You forgot () when closing in the client.
Use '127.0.0.1' instead of binding binding/connecting to 'socket.gethostname()'. If you want others to be able to connect, bind on '0.0.0.0'.
Also, you're using the low-level socket library, which might be a bad idea for an introduction. Sadly, while Python has a standard higher-level socket
server library (SocketServer), there isn't anything like that included for clients. Instead, I'd recommend that you look at
Twisted (for both of them), which is an event-based high-level networking library, which can automatically handle things like waiting for EOLs, or automatically reconnecting, for you.
You look up any type of networking in python tutorials?
The problem with networking in Python (especially clients) is that there isn't a nice general way to do it. You either have socket which is pretty low-level, or you have Twisted, which is like a whole ecosystem on it's own. There are also some other approaches like gevent (which is a monkey-patch around low-level libraries so that you can use socket-based libraries to do somewhat Twisted-resembling stuff) or Diesel (which is just a piece of crap at the moment).
I found a youtube tutorial 2 weeks ago explaining how to make a server send messages to a client, but then once I inputted everything, Python gave it an error then I looked at the date and it said it was made like a long time ago, where the code is outdated.
Today I found a tutorial which was more like a reference rather than a tutorial. Nonetheless, I still got the code you see in the OP from it, and it works perfectly. I just start the server then start the client and the server prints that the client connected to the server. I could probably modify this but I never tampered with sockets or addresses so i'm not really sure how to make the client send data to the server.
Really all I want to make here is a server-sided save data system, where the client plays a game, and it sends data to the localhost server every time he does something, and when he quits and re-logs back in, it loads his stuff.
What version of Python do you have installed?