Python 3.4 - 二维图形库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22881600/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 01:52:41  来源:igfitidea点击:

Python 3.4 - Library for 2D graphics

pythonpython-3.xgraphicsdrawing

提问by user3385945

As title says, I'm looking for a 2D graphic library, where I can create a window, and then draw lines and basic shapes on it. I was searching around for a similar topics, and I've found something about GTK & Cairo. I have some experience with drawing in Java 2D Graphics library, so I would like to be able to create some small games like Space Invaders, Snake...

正如标题所说,我正在寻找一个 2D 图形库,我可以在其中创建一个窗口,然后在其上绘制线条和基本形状。我在四处寻找类似的主题,我发现了一些关于 GTK 和开罗的东西。我有一些在 Java 2D 图形库中绘图的经验,所以我希望能够创建一些小游戏,如 Space Invaders、Snake...

采纳答案by sshashank124

If you are looking for a slightly more static version of GUI which is less about moving visuals, you should check out Tkinterwhich comes as python's default GUI

如果您正在寻找一个稍微更静态的 GUI 版本,而不是关于移动视觉效果,您应该查看Tkinter,它作为 python 的默认 GUI

On the other hand, if you want to make "small games like Space Invaders, Snake...", the pygamemodule would provide you with a great set of tools to easily create these games. I suggest you check them both out and see which one suits your needs better.

另一方面,如果您想制作“太空入侵者、贪吃蛇……之类的小游戏”,pygame模块将为您提供一组很棒的工具来轻松创建这些游戏。我建议你检查它们,看看哪一个更适合你的需求。

Good Luck

祝你好运