2014-01-31 2 views
-1

Errr может кто-нибудь мне помочь. Когда я пытаюсь запустить код, я получаю эту ошибку: EOL при сканировании строкового литерала ?????????EOL во время сканирования строкового литерала, синтаксическая ошибка Python Pygame?

Вот мой код (его главное меню игры):

bif="menubg.jpg" 
load_check_x = "null" 
load_check_y = "null" 
import pygame, sys 
from pygame.locals import * 
x = 0 
y = 0 

pygame.init() 
screen=pygame.display.set_mode((640,360),0,32) 
background=pygame.image.load(bif).convert() 
screen.fill(BLACK) 

class MainWindow: 
    def __init__(self,screen): 
     new_text = menu_font.render('Play!!!!', 1, (100, 100, 100)) 
     screen.blit(new_text, (340, 425)) 
     while True: 

      evc = pygame.event.get() 

      x,y = pygame.mouse.get_pos() 
      #Setup mouse pos!!! 
      if x >= 340 and x <= 465: 
       load_check_x = "True" 
      if x < 340 or x > 465: 
       load_check_x = "False" 

      if y >= 425 and y <= 445: 
       load_check_y = "True" 
      if y < 425 or y > 445: 
       load_check_y = "False" 

      if load_check_x == "True" and load_check_y == "True: 
       for event.type == pygame.MOUSEBUTTONUP: 
        clear() 

def clear(): 
    screen.fill(BLACK) 
+0

Отсутствует закрытие ' "'' на load_check_y ==" True:'. –

ответ

2

Как подсветкой синтаксиса показывает, вы забыли закрывающий двойные кавычки в вашем прошлом, если заявление.

if load_check_x == "True" and load_check_y == "True: 

должно быть ...

if load_check_x == "True" and load_check_y == "True": 
+0

Ха, как я не заметил, что ... – user3256142