Windows 7 64 位 - 安装了 Python 2.7.3 64 位 - Pygame 问题 [英] Windows 7 64bit - Python 2.7.3 64bit installed - Pygame issues

查看:66
本文介绍了Windows 7 64 位 - 安装了 Python 2.7.3 64 位 - Pygame 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人能帮忙解决这个问题.

I hope someone can help with this.

  • 我已经安装了 Python 2.7.3 64 位版本

  • I have installed Python 2.7.3 64 bit version

我有 Windows 7 64 位操作系统

I have Windows 7 64 bit OS

我已经安装了 64 位版本的 Pygame.

I have installed 64 bit versions of Pygame.

它们似乎安装和模块导入没有任何问题.

They appear to install and the module import without any issue.

当我在控制台中运行一些简单的脚本进行测试时:

When i run some simple script in the console to test:

import pygame

deepblue = (26,0,255)

mintcream = (254,255,250)

pygame.init()

size = (500,500)

surface = pygame.display.set_mode(size)

pygame 窗口打开.背景是黑色的

pygame window opens. the background is black

然后输入:

surface.fill(deepblue)

pygame.display.update()

pygame 窗口应该填充蓝色背景,但只是崩溃.显示为无响应.

The pygame window should fill with a blue background but just crashes. Showing as not responding.

我在 2.7.3 上在 linux 上测试了相同的代码,它没有任何问题.

I have tested the same code on 2.7.3 on linux and it works without any issue.

我在官方 pygame 下载站点上读到 64 位用户应该使用 32 位版本,但我得到了相同的结果.

I read on the official pygame download site that 64 bit user should use the 32 bit version but i get the same result.

在 64 位机器上我应该安装 32 位 Python 和 32 位 Pygame 吗?

On 64 bit machine should i install 32 bit Python and 32 bit Pygame?

有人可以帮忙吗?有没有其他人遇到过同样的问题?

Can anyone help with this? Has any one else had the same issue?

是否有已经安装了 Pygame 的 Python 安装程序?

Is there a installer that gives Python with Pygame already installed?

非常感谢任何帮助.

推荐答案

非常感谢您的帮助.它现在完全正常工作.

Thank you very much for your help. It is now fully working.

安装和卸载已经三天了,阅读无数网页,然后努力在工作中保持清醒 LOL!

It has been three days of install and uninstall, reading countless web pages and trying to stay awake at work after it LOL!

我猜是编程的痕迹和错误:)

trail and error of programming I guess :)

我从 http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

其中安装了 Pygame 版本 1.9.2a0

Which installed Pygame version 1.9.2a0

我按照建议将代码从使用 update() 更改为 flip()

I changed the code as advised from using update() to flip()

我还在 while 循环中使用了 pygame.event.get

I also used the pygame.event.get within the while loop

pygame 窗口没有像以前那样崩溃.

The pygame window does not crash as before.

我已经添加了更新的脚本,以便其他人可以受益

I have added the udpated script so others can benefit

import pygame, sys

running = True

deepblue = (26,0,255)
mintcream = (254,255,250)
pygame.init()
size = (500,500)
surface = pygame.display.set_mode(size)
surface.fill(deepblue)
position = (250,250)
radius = 50
linewidth = 2
pygame.draw.circle(surface, mintcream, position, radius, linewidth)
pygame.display.flip()

while running:
    event = pygame.event.wait()
    if event.type == pygame.QUIT:
        running = False
pygame.quit()

这篇关于Windows 7 64 位 - 安装了 Python 2.7.3 64 位 - Pygame 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆