import sys
import pygame
pygame.init()
size = width,height = 320,240
screen = pygame.display.set_mode(size)
color = (0,0,0)
pic = pygame.image.load("pythonStart.png")
picrect = pic.get_reect()
while True :
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
screen.fill(color)
screen.blit(pic,picrect)
pygame.display.flip()
##游戏框出现后一闪就没了。报错如下,请大神指教!谢谢
-------------------------------
pygame 1.9.5
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "F:\SublimeText\HelloSublime.py", line 8, in
pic = pygame.image.load("pythonStart.png")
pygame.error: Couldn't open pythonStart.png
[Finished in 1.9s with exit code 1]
[shell_cmd: python -u "F:\SublimeText\HelloSublime.py"]
[dir: F:\SublimeText]
[path: F:\Python\Python37;G:\pyStart;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\idmu\common;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;F:\Python\Python37;F:\Python\Python37\Scripts\;F:\Python\Python37]
用sublime写python中pygame.image.load()图片引用后不显示。
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
悬赏问题
- ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
- ¥15 ubuntu虚拟机打包apk错误
- ¥199 rust编程架构设计的方案 有偿
- ¥15 回答4f系统的像差计算
- ¥15 java如何提取出pdf里的文字?
- ¥100 求三轴之间相互配合画圆以及直线的算法
- ¥100 c语言,请帮蒟蒻写一个题的范例作参考
- ¥15 名为“Product”的列已属于此 DataTable
- ¥15 安卓adb backup备份应用数据失败
- ¥15 eclipse运行项目时遇到的问题