The Art of Doing: Python Network Applications with Sockets!

The Art of Doing:  Python Network Applications with Sockets!

The Art of Doing: Python Network Applications with Sockets!

Create an online multiplayer game, AOL style chat room, and more! Learn the socket, threading, json, Pygame modules!

Language: english

Note: 4.2/5 (4 notes) 2,194 students  New course 

Instructor(s): Michael Eramo

Last update: 2022-08-17

What you’ll learn

  • Networking Fundaments such as IP and port addresses, IPV4, TCP, and UDP protocols.
  • How to set up your own home network with static IP addresses and port forwarding so anyone can connect to your programs over the internet.
  • How to use the socket module to create a basic two way chat in the terminal.
  • How to use the threading module to create a basic chat room in the terminal.
  • How to use tkinter module to make a GUI chat room like the old AOL chat rooms.
  • How to use the Json module to create an advanced GUI chat room with and admin window.
  • How to use the Pygame module to make your own online multiplayer game.

 

Requirements

  • Students should have a working knowledge of Python and fundamental programming principles
  • Students should be comfortable with functional programming and object oriented programming as the course will utilize both towards the second half.
  • Familiarity with various python modules will be beneficial but I will take the time to teach what you need to know to build the programs in this course.

 

Description

Have you ever wanted to build your own online multiplayer game that you and your friends could play?  How about wanting to build your own chat room like the golden AOL chat rooms from the 1990’s that you and your friends could “hang out” it.  Want to learn the underlying principles of how programs like these work – how they can communicate and send data back and forth from one computer to the next over the internet?  If the answer is yes, then please consider taking this course!

I know in my own journey with Python and computer science, once I got past the basics…the fundamentals…the whole “this is a for loop.  Can you print the first 100 even numbers?” type exercises, the doors really opened up.  There was only one problem:  the doors opened up to a HUGE space, with very little guidance.  Python is great because you can do so much with it, especially when you start to bring in new modules and libraries that give added functionality.  While there are ample beginner resources out there willing to hold your hand and guide you through the learning, I felt there were significantly less targeting this intermediate audience…The audience that has learned the basics and are now looking for something more…

In this course, I decided to focus my intermediate projects around networking applications; I wanted to write programs that could talk to each other online, both across my local area network and across the internet as a whole.  With this in mind, I asked myself what are some fun and engaging projects students would enjoy learning with and what external modules and libraries should we know to accomplish these projects.   In this course we will complete the following:


  • A two-way terminal based chat introducing the socket module

  • A terminal based chat room introducing the threading module

  • A GUI chat room introducing the Tkinter module

  • How to configure your router to allow communication from an external network

  • An advanced GUI chat room with admin window introducing the json/pickle modules

  • An online multiplayer game introducing the Pygame module


Each project builds on the knowledge gained during the previous projects.  In our culminating project, when we attempt to create our own online multiplayer game, we will be generating IPV4/TCP sockets to connect computers to a server running on a machine with a static IP and port forwarding enabled, creating various threads to run processes concurrently on our machines, we’ll use json to serialize python objects such as our game state and game players, and have a full interactive GUI interface using Pygame.

By the end of this course you will have multiple projects you can share with friends or family, have them run a client script from their house, connect to your server script, and show off all you learned. 

 

Who this course is for

  • I would consider this to be an intermediate course for those who have a firm understanding of python basics and are looking for ways to create new and exciting projects using various python modules.
  • Anyone who is interested in learning how to write programs that can work over a network and communicate with one another.
  • Anyone who likes online multiplayer GAMES!!!

 

Course content

  • Installation and Setup
    • Course Preview
    • Python Installation and Setup
    • VS Code Installation
    • Creating Our Working Directory
    • A Brief Overview of Networking Concepts
  • Creating TCP and UDP Connections with the Socket Module
    • Creating a TCP Server Socket
    • Creating a TCP Client Socket
    • Sending Data Through a TCP Connection
    • Creating and Sending Data Through a UDP Server/Client
    • Exploring the Buffer Size
    • Basic Two-Way Chat Part 1 – Server/Client Setup
    • Basic Two-Way Chat Part 2 – Enabling The Chat
  • Creating a Terminal Chat Room with the Threading Module
    • The Threading Module Basics Part 1
    • The Threading Module Basics Part 2
    • Terminal Chat Room Part 1 – Server/Client Setup
    • Terminal Chat Room Part 2 – Adding Functionality
    • Terminal Chat Room Part 3 – Adding Functionality
    • Terminal Chat Room Part 4 – Adding Functionality and Testing
  • Creating a Basic GUI Chat Room with the Tkinter Module
    • The Tkinter Module – Defining A Root Window
    • The Tkinter Module – Adding Frames
    • The Tkinter Module – Adding Widgets
    • The Tkinter – Module – Adding Functionality
    • Basic GUI Chat Room Part 1 – Building the Client Layout
    • Basic GUI Chat Room Part 2 – Building the Client Layout
    • Basic GUI Chat Room Part 3 – Adding Functionality
    • Basic GUI Chat Room Part 4 – Adding Functionality and Testing
  • Creating an Advanced GUI Chat Room with the Json Module
    • The Pickle Module – Sending Objects Through the Data Stream
    • The Json Module – Sending Objects Through the Data Stream
    • Advanced GUI Chat Room Part 1 – Updating the Client Layout
    • Advanced GUI Chat Room Part 2 – Building the Server Layout
    • Advanced GUI Chat Room Part 3 – Outlining Server Functionality
    • Advanced GUI Chat Room Part 4 – Outlining Client Functionality
    • Advanced GUI Chat Room Part 5 – Staring the Server
    • Advanced GUI Chat Room Part 6- Processing Messages Server Side
    • Advanced GUI Chat Room Part 7 – Starting the Client
    • Advanced GUI Chat Room Part 8 – Sending Data from Client to Server
    • Advanced GUI Chat Room Part 9 – Adding Admin Functionality
    • Advanced GUI Chat Room Part 10 – Adding Admin Functionality
    • Advanced GUI Chat Room Part 11 – Final Testing
  • Connecting to the Outside World
    • Adjusting Host Firewall for LAN Communication
    • Setting a Static IP Address for WAN Communication
    • Enabling Port Forwarding for WAN Communication
    • Testing out WAN Communication
    • Configuring A Second Router…Different Settings!
  • Creating a Multiplayer Game with the Pygame Module
    • The Pygame Module – Creating a Game Window and Game Loop
    • The Pygame Module – Setting Up a Game Class
    • The Pygame Module – Setting Up a Player Class
    • Using Fixed Length Headers – The Shortcomings of a Fixed Maximum Byte Size
    • Using Fixed Length Headers – The Solution to our Problems
    • Online Multiplayer Game Part 1 – Setting Up the Server
    • Online Multiplayer Game Part 2 – Setting Up the Client
    • Online Multiplayer Game Part 3 – Sending Pygame Configurations to the Client
    • Online Multiplayer Game Part 4 – Creating a Player on the Server
    • Online Multiplayer Game Part 5 – Sending the Player to the Client
    • Online Multiplayer Game Part 6 – Starting the Game on the Server
    • Online Multiplayer Game Part 7 – Starting the Game on All Clients
    • Online Multiplayer Game Part 8 – Player Movement on the Client
    • Online Multiplayer Game Part 9 – Creating a Game State on the Server
    • Online Multiplayer Game Part 10 – Processing Game State on All Clients
    • Online Multiplayer Game Part 11 – Resetting the Game for More Rounds
    • Online Multiplayer Game Part 12 – Official Network Playtest!

 

Time remaining or 867 enrolls left

 

Don’t miss any coupons by joining our Telegram group 

Udemy Coupon Code 100% off | Udemy Free Course | Udemy offer | Course with certificate