3

I can run Pygame Zero programs from idle if I add the necessary code. but when I try to run it from the command line no matter what file or folder I try to put my Pygame zero project in, it will not open a window it only says Pygame 1.9.5. Then, the line beneath that says "Hello" from the pygame community and gives me the main page of pygame's url.

The command I am using to try and run is pgzrun which multiple sources say should work.

I am using Windows 10, and have Pygame installed and Pygame Zero installed. I am using python version 3.7.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
Tlang55
  • 31
  • 2
  • 1
    Have you tried just executing the script with your python interpreter? That’s what I’ve always done and it works. But as far as your question goes, could you please add a minimal, reproducible example to your question? That’ll help us find what exactly the problem is. – MegaEmailman Dec 04 '19 at 00:32
  • 1
    don't you get any error message ? always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot). There are other useful information. – furas Dec 04 '19 at 01:19
  • 1
    did you try to run `python your_script.py` ? or `C:/full/path/to/python.exe your_script.py` ? – furas Dec 04 '19 at 01:21

1 Answers1

0

As explained here, add the following line at the top of your Python script:

import pgzrun

and the following line at the bottom:

pgzrun.go()

Then run it as a normal Python script, i.e. python your_script.py

r0the
  • 617
  • 4
  • 13