[Tutor] Help with Pygame

DL Neil PyTutor at DancesWithMice.info
Fri May 1 19:34:29 EDT 2020


On 1/05/20 12:11 PM, Benjamin Tsai wrote:
> Hi there,
> 
> I just recently bought a new computer back in december and installed python
> on my computer. However, for some reason, I can't run pygame successfully.
> 
>   I am using Pycharm and using my system interpreter of python 3.7, which I
> installed using homebrew in the terminal. I've installed the pygame module
> and the code runs fine (the message "Hello from the pygame community" pops
> up in the console). In addition, a pop-up window called "pygame window"
> opens, but nothing in my test code after my for loop works. I've tried
> looking for a lot of solutions online and deleted and redownloaded python a
> few times and I'm quite new to Pycharm so I'm not sure if this is a pycharm
> or python problem. Any help would be appreciated.

After various setup commands, Pygame will open its window (as 
described). The usual problem with display thereafter, is forgetting to 
update the display window/flip the screen-buffers. This needs to be 
accomplished within the event loop, after every 'move' or change to the 
screen's contents. It's often the last line of code within the event-loop.


> Sidenote: is there an easy way I can get back to "square one" with python
> without damaging the python that inherently comes with my computer?

That sounds like a PyCharm question and depends upon how you/it 
installed the version of Python other than the system-version.
-- 
Regards =dn


More information about the Tutor mailing list