简体   繁体   中英

My Python code doesn't run properly on Linux pycharm

import pygame
import sys
from pygame.locals import *
import time

pygame.init()
windos_surface_obj = pygame.display.set_mode((1366, 786))
pygame.display.set_caption("pygame cheat sheet")
me = pygame.image.load("265-2652950_circulodeluz-luz-circulo-neonlights-light-circle-glowing-circle.png")

fpsclock = pygame.time.Clock()
mousex, mousey = 0, 0
windos_surface_obj.convert()
white = pygame.Color(255, 255, 255)

while True:
   for i in range(1, 10, 1):
    j = 10 - i + 1
    windos_surface_obj.fill(white)
    me = pygame.transform.scale(me, (i * 50, j * 50))
    windos_surface_obj.blit(me, (100,100))
    print(1)
    time.sleep(1/10)
   for j in range(1, 10, 1):
    i = 10 - j + 1
    windos_surface_obj.fill(white)
    me = pygame.transform.scale(me, (i * 50, j * 50))
    windos_surface_obj.blit(me, (100,100))
    print(1)
    time.sleep(1/10)

  pygame.display.update()

  fpsclock.tick(100)

I can't understand why it shows frozen screen.

My specs: Linux Mint, Intel Core i3, 4gb RAM, using pycharm edu.

This shows on running, it doesn't proceed:

在此处输入图像描述

import pygame
import sys
from pygame.locals import *
import time

pygame.init()
windos_surface_obj = pygame.display.set_mode((1366, 786))
pygame.display.set_caption("pygame cheat sheet")
me = pygame.image.load("265-2652950_circulodeluz-luz-circulo-neonlights-light-circle-glowing-circle.png")

fpsclock = pygame.time.Clock()
mousex, mousey = 0, 0
windos_surface_obj.convert()
white = pygame.Color(255, 255, 255)

while True:
   for i in range(1, 10, 1):
    j = 10 - i + 1
    windos_surface_obj.fill(white)
    me = pygame.transform.scale(me, (i * 50, j * 50))
    windos_surface_obj.blit(me, (100,100))
    print(1)
    time.sleep(1/10)
   for j in range(1, 10, 1):
    i = 10 - j + 1
    windos_surface_obj.fill(white)
    me = pygame.transform.scale(me, (i * 50, j * 50))
    windos_surface_obj.blit(me, (100,100))
    print(1)
    time.sleep(1/10)

  pygame.display.update()

  fpsclock.tick(100)

I can't understand why it shows frozen screen.

My specs: Linux Mint, Intel Core i3, 4gb RAM, using pycharm edu.

This shows on running, it doesn't proceed:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM