Python Forum
Free Online IDE / Interpreter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Free Online IDE / Interpreter
#3
There are many good online environment like eg Codespaces, Replit, Colab
The problem with Pygame is that in need native OS stuff,so no window will show up in browser in these environments.

I don't have Chromebook so untested.
Step 1: Ensure Linux (Crostini) is Enabled
Scroll down to Linux (Beta) and turn it on.

Step 2: Update Linux and Install Dependencies
sudo apt-get update
sudo apt-get upgrade
Step 3: Install dependencies and Python3 and Pip
sudo apt-get install libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
sudo apt-get install python3 python3-pip
Step 4: Install pygame
pip3 install pygame
Step 5: Verify the Installation
# test_pygame.py
import pygame
pygame.init()

# Set up display
window = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Pygame Test')

# Main loop
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

pygame.quit()
In terminal.
python3 test_pygame.py
Pedroski55 and XavierPlatinum like this post
Reply


Messages In This Thread
Free Online IDE / Interpreter - by Jameyson72 - May-27-2024, 04:26 PM
RE: Free Online IDE / Interpreter - by Gribouillis - May-27-2024, 06:26 PM
RE: Free Online IDE / Interpreter - by snippsat - May-27-2024, 08:04 PM
RE: Free Online IDE / Interpreter - by ebn852_pan - May-28-2024, 06:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with free online book Ummusabbar 4 3,883 Mar-11-2018, 12:34 PM
Last Post: Ummusabbar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020