Getting started - websockets 12.0 documentation
Description: Requirements: websockets requires Python ≥ 3.8. It doesn’t have any dependencies. Installation: Install websockets with: Wheels are available for all platforms. Tutorial: Learn how to build an real...

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Getting started

## Requirements

websockets requires Python ≥ 3.8.

Use the most recent Python release

For each minor version (3.x), only the latest bugfix or security release (3.x.y) is officially supported.

It doesn’t have any dependencies.

## Installation

Install websockets with:

    $ pip install websockets

Wheels are available for all platforms.

## Tutorial

Learn how to build an real-time web application with websockets.

- Part 1 - Send & receive
  - Prerequisites
  - Download the starter kit
    - `PLAYER1`
    - `PLAYER2`
    - `createBoard()`
    - `playMove()`
    - `PLAYER1`
    - `PLAYER2`
    - `Connect4`
      - `Connect4.play()`
      - `Connect4.moves`
      - `Connect4.winner`
  - Bootstrap the web UI
  - Bootstrap the server
  - Transmit from browser to server
  - Transmit from server to browser
  - Add the game logic
  - Summary
  - Solution
- Part 2 - Route & broadcast
  - Share game state
  - Start a game
  - Join a game
  - Add the game logic
  - Watch a game
  - Broadcast
  - Summary
  - Solution
- Part 3 - Deploy to the web
  - Commit project to git
  - Prepare the WebSocket server
  - Deploy the WebSocket server
  - Prepare the web application
  - Deploy the web application
  - Summary
  - Solution

## In a hurry?

Look at the quick start guide.