0


pycharm如何安装pygame库

pycharm如何安装pygame库

PyCharm是Python中广受欢迎的一种IDE,它可以为用户提供许多工具和便利的服务,从而大大提高开发效率。pygame库可以用python进行游戏开发提供很好的支持,那么在ptcharm中如何安装pygame库呢?

一、安装步骤
1.打开pycharm软件,新建一个项目,然后打开菜单栏“File"->“Settings”,进入"Project:您的项目名"->“Project Interpreter”。
2.点击右上角”+“按钮,搜索栏中输入”pygame"。出现可安装的pygame库。
3.点击“Install Package",本地或远程安装库。
4.安装完成后,在PyCharm中可以使用pygame库了。

二、试验是否安装成功

import pygame
pygame.init()
win=pygame.display.set_mode((800,600))
running=True
whilerunning:for event in pygame.event.get():if event.type==pygame.QUIT:
            running=False
pygame.quit()

代码运行结果图
在这里插入图片描述

标签: pygame pycharm python

本文转载自: https://blog.csdn.net/lly_117/article/details/136293214
版权归原作者 钰061 所有, 如有侵权,请联系我们删除。

“pycharm如何安装pygame库”的评论:

还没有评论