Installation of pygame in python

I want to run directly without learning to walk. After learning a little python, I want to find the source code of some small games to play, but I need a library called pygame during the running process. After some exploration, I finally found a relatively simple (wu) Single (nao) installation method.

The first step—>下载及安装

Cmd to open a command prompt, direct input py -m pip install -U pygame --userand then press the Enter key, download and install pygame library is automatically started.
Insert picture description here

Step Two—>检测是否成功

First, in a terminal pythomenter shell, then type import pygame, press the Enter key, if the installation was successful if the version number is displayed below the (ps: it should not fail, I have installed uninstalled many times.)
Insert picture description here

Step Three—>开始测试小游戏啦!

What I found here is a little snake-eating game (the source code I found directly, the level is limited, I can’t write it yet), let’s see the effect?
(It’s not my dish, but the speed setting is really fast?)
Insert picture description here
Attachment 1: It will be needed during the installation process. pipIn my opinion, this is also more torturous. When installing other libraries, it will be used after some exploration. Detailed tutorials can be searched by yourself.
Appendix 2: Uninstall pygame库direct inputpip uninstall pygame
欢迎大佬赐教

Guess you like

Origin blog.csdn.net/weixin_43716048/article/details/95791582
Recommended