[Python] My main.py imports from other .py files. Will Pygbag cause an issue?

Discussão em 'Python' iniciado por Stack, Junho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I recently developed a minesweeper game in python using the pygame library. I wanted to make it accessible on the web browser, so I stumbled across pygbag library. I have a main.py file and I made all the changes required for pygbag to work. When I try running the local server, I get the default ready to start page. But once I click on it, I just get a black screen. I tried using the debug console and fixed some sound file format errors it threw. Now I don't see any errors, but it stops at the following line:enter image description here

    My directory structure is as follows:

    --minesweeper-pygame
    --assets
    --build (this is the build that gets created after running pygbag command
    --main.py
    --settings.py
    --sprites.py
    --pyproject.toml


    My settings.py loads all the assets and sprites.py creates the board and such, while main.py is where the main game loop and logic exists. Main.py loads everything from both settings.py and sprites.py at the start.

    I noticed in the image above that it's trying to pull settings.py and sprites.py from some archive repo. Could this be the reason my game isn't loading? Does all the code need to in main.py or is there a better way to import the other files?

    Continue reading...

Compartilhe esta Página