Python 如何填充一行文本框中的下一项

Python 如何填充一行文本框中的下一项,python,python-3.x,pygame,Python,Python 3.x,Pygame,我是一名学生程序员,遇到了一个问题,我真的需要一些建议。 基本上,我试着制作一个大的文本框,但没有pygame的效果。font.render()不允许多行,所以我将它划分为多个较小的框(12),目前每个按钮都绑定到一个文本框。我有识别下一个空盒子的代码,但我一直在填充它。 使用的变量具有以下目的: Item1=定义文本框中的文本 Empty_row=定义下一个可用的空文本框 我知道很多,所以任何建议都非常感谢。我也知道有更好的模块可以使用,但我的评估需要pygame 这是从开始到结束的一个框的代

我是一名学生程序员,遇到了一个问题,我真的需要一些建议。 基本上,我试着制作一个大的文本框,但没有pygame的效果。font.render()不允许多行,所以我将它划分为多个较小的框(12),目前每个按钮都绑定到一个文本框。我有识别下一个空盒子的代码,但我一直在填充它。 使用的变量具有以下目的: Item1=定义文本框中的文本 Empty_row=定义下一个可用的空文本框 我知道很多,所以任何建议都非常感谢。我也知道有更好的模块可以使用,但我的评估需要pygame

这是从开始到结束的一个框的代码,如果需要,下面将是整个应用程序

import pygame,sys
点击=布尔
pygame.init()
clock=pygame.time.clock()
screen=pygame.display.set_模式((1200,800),0,32)
font3=pygame.font.SysFont(无,25)
第1项=“”
第2项=“”
Item1_rect=pygame.rect(78033400547)
Item2_rect=pygame.rect(780,58400547)
颜色=pygame.Color(0,0,0)
发现=错误
keys=pygame.key.get_pressed()
单击=pygame.MOUSEBUTTONDOWN
sc1_num=0
sc1_价格=0
sc2_num=0
sc2_价格=0
def Main_sales():
#此代码区域是从以前的文件中重用的
#这是RAD方法的一个例子。
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~从以前的程序应用的开始代码
全球项目1
全球项目2
全局项1
全局项2
全局单击
全局sc1_num
全球sc1_价格
全局sc2_num
全球sc2_价格
尽管如此:
对于pygame.event.get()中的事件:
如果event.type==退出:
打印(“退出”)
pygame.quit()
sys.exit()
如果event.type==pygame.MOUSEBUTTONDOWN:
如果event.button==1:
单击=真
屏幕填充((255、255、255))
text1_surface=font3.render(Item1,True,(0,0,0))
屏幕blit(文本1_表面,(项1_rect.x+20,项1_rect.y+100))
text2_surface=font3.render(Item2,True,(0,0,0))
屏幕blit(文本2曲面,(项目2矩形x+20,项目2矩形y+100))
mx,my=pygame.mouse.get_pos()
b_w=180
b_h=70
b3_x=55
b3_y=200
b4_x=275
b4_y=200
button_3=pygame.Rect(b3_x,b3_y,b_w,b_h)
button_4=pygame.Rect(b4_x,b4_y,b_w,b_h)
如果Item1='':
空_行=1
elif项目2=='':
空_行=2
打印(空行)
如果按钮_3.碰撞点(mx,my):
如果单击:
sc1\u num=sc1\u num+1
sc1\u价格=sc1\u价格+15
Item1=(f“Scrunchie1{sc1_num}${sc1_price}”)
打印(“按钮3”)
如果按钮_4.碰撞点(mx,my):
如果单击:
sc2数量=sc2数量+1
sc2_价格=sc2_价格+15
项目2=(f“Scrunchie2{sc2_num}${sc2_price}”)
打印(“按钮4”)
pygame.draw.rect(屏幕、颜色、按钮3、2)
pygame.draw.rect(屏幕、颜色、按钮4、2)
screen.blit((font3.render(“Scrunchie1”,True,(0,0,0)),(b3_x+20,b3_y+15))
screen.blit((font3.render(“Scrunchie2”,True,(0,0,0)),(b4_x+20,b4_y+15))
单击=False
#更新屏幕
pygame.display.update()
时钟滴答(60)
def QUIT():
运行=真
运行时:
pygame.quit()
退出
#运行主菜单
主要销售()
pygame.quit()
这基本上就是2个按钮的全部代码。我修正了不会停留太久的问题,但基本问题仍然存在。如何让文本填充第一个文本框而不是指定给它的文本框

# window ----------------------------------------
"""
This file is the executable file which calls all other files including the
full application.
"""
#The following imports are modules which have prewritten
#functions which I am able to use. They came predownloaded
#with python as well as downloading some from pygame.org
import pygame, sys


from collections import Counter as count
from datetime import datetime
import time
import string


#import read
mainClock = pygame.time.Clock()

#setting window
from pygame.locals import *
#The following are Constants which are defined here for easier maintanence
click = bool
pygame.init()
pygame.display.set_caption('LeVOGUE')
clock = pygame.time.Clock()
screen = pygame.display.set_mode((1200, 800), 0, 32)
windowSurface = pygame.display.set_mode((1200, 650), pygame.DOUBLEBUF)

                                     
run = 2
font = pygame.font.SysFont(None, 35)
font2 = pygame.font.SysFont(None, 70)
font3 = pygame.font.SysFont(None, 25)
base_font = pygame.font.Font(None, 50)
base_font2 = pygame.font.Font(None, 160)
Item1 = ''
Item2 = ''
Item3 = ''
Item4 = ''
Item5 = ''
Item6 = ''
Item7 = ''
Item8 = ''
Item9 = ''
Item10 = ''
Item11 = ''
Item12 = ''

Item1_rect = pygame.Rect(780, 33, 400, 547)
Item2_rect = pygame.Rect(780, 58, 400, 547)
Item3_rect = pygame.Rect(780, 83, 400, 547)
Item4_rect = pygame.Rect(780, 108, 400, 547)
Item5_rect = pygame.Rect(780, 133, 400, 547)
Item6_rect = pygame.Rect(780, 158, 400, 547)
Item7_rect = pygame.Rect(780, 183, 400, 547)
Item8_rect = pygame.Rect(780, 208, 400, 547)
Item9_rect = pygame.Rect(780, 233, 400, 547)
Item10_rect = pygame.Rect(780, 258, 400, 547)
Item11_rect = pygame.Rect(780, 283, 400, 547)
Item12_rect = pygame.Rect(780, 308, 400, 547)

row = 1

Colour = pygame.Color(0,0,0)
found =False
#key_text_num = 2
s = " "
fh =open("user_info.txt", "r")


keys = pygame.key.get_pressed()
click = pygame.MOUSEBUTTONDOWN
Volume = True
active = False
#tick_active = False


#This is responsible fo importing the mixer module
from pygame import mixer
#Load music file
mixer.music.load("MainMenuMusic.mp3")
#play music file
mixer.music.play()



sc1_num = 0
sc1_price = 0
sc2_num = 0
sc2_price = 0
sc3_num = 0
sc3_price = 0
sc4_num = 0
sc4_price = 0
sc5_num = 0
sc5_price = 0
sc6_num = 0
sc6_price = 0
sc7_num = 0
sc7_price = 0
sc8_num = 0
sc8_price = 0
sc9_num = 0
sc9_price = 0
sc10_num = 0
sc10_price = 0
sc11_num = 0
sc11_price = 0
sc12_num = 0
sc12_price = 0


        
        


def Main_sales():
#this area of the code was reused from a previous file
#which is an example of the RAD approach.

#~~~~~~~~~~~~~~~~~Start Code applied from previous programs~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
    
    global Item1
    global Item2
    global Item3
    global Item4
    global Item5
    global Item6
    global Item7
    global Item8
    global Item9
    global Item10
    global Item11
    global Item12
    global Item1_rect
    global Item2_rect
    global Item3_rect
    global Item4_rect
    global Item5_rect
    global Item6_rect
    global Item7_rect
    global Item8_rect
    global Item9_rect
    global Item10_rect
    global Item11_rect
    global Item12_rect 
    global click
    global active
    global bags
    global current_time
    global found
    global count
    global s
    global fh
    global i_a
    global key_text_num
    global sc1_num
    global sc1_price
    global sc2_num
    global sc2_price
    global sc3_num
    global sc3_price
    global sc4_num
    global sc4_price
    global sc5_num
    global sc5_price
    global sc6_num
    global sc6_price
    global sc7_num
    global sc7_price
    global sc8_num
    global sc8_price
    global sc9_num
    global sc9_price
    global sc10_num
    global sc10_price
    global sc11_num
    global sc11_price
    global sc12_num
    global sc12_price
    global row
        
#This checkbox is imported from a module found within the LeVOGUE folder
#The checkbox file is imported above and called with the function checkbox
    

    
    while True:
        #Defining Quit
        for event in pygame.event.get():
            if event.type == QUIT:
                print("Quit")
                pygame.quit()
                sys.exit()

#~~~~~~~~~~~~~~~~~~~~~~~~End Code applied from tutorial~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            #if key escape key is pressed, Quit    
            if event.type == KEYDOWN:
                if event.key == K_ESCAPE:
                    pygame.quit()
                    sys.exit()
               
                    
            #if click, click is true
            if event.type == MOUSEBUTTONDOWN:
                if event.button == 1:
                    click = True

            
           
            

            if click:
                print(pygame.mouse.get_pos())
        
        #Background colour
        screen.fill((255, 255, 255))

        text1_surface = font3.render(Item1, True, (0,0,0))
        screen.blit(text1_surface, (Item1_rect.x+20 , Item1_rect.y +100))

        text2_surface = font3.render(Item2, True, (0,0,0))
        screen.blit(text2_surface, (Item2_rect.x+20 , Item2_rect.y +100))

        text3_surface = font3.render(Item3, True, (0,0,0))
        screen.blit(text3_surface, (Item3_rect.x+20 , Item3_rect.y +100))

        text4_surface = font3.render(Item4, True, (0,0,0))
        screen.blit(text4_surface, (Item4_rect.x+20 , Item4_rect.y +100))

        text5_surface = font3.render(Item5, True, (0,0,0))
        screen.blit(text5_surface, (Item5_rect.x+20 , Item5_rect.y +100))

        text6_surface = font3.render(Item6, True, (0,0,0))
        screen.blit(text6_surface, (Item6_rect.x+20 , Item6_rect.y +100))

        text7_surface = font3.render(Item7, True, (0,0,0))
        screen.blit(text7_surface, (Item7_rect.x+20 , Item7_rect.y +100))

        text8_surface = font3.render(Item8, True, (0,0,0))
        screen.blit(text8_surface, (Item8_rect.x+20 , Item8_rect.y +100))

        text9_surface = font3.render(Item9, True, (0,0,0))
        screen.blit(text9_surface, (Item9_rect.x+20 , Item9_rect.y +100))

        text10_surface = font3.render(Item10, True, (0,0,0))
        screen.blit(text10_surface, (Item10_rect.x+20 , Item10_rect.y +100))

        text11_surface = font3.render(Item11, True, (0,0,0))
        screen.blit(text11_surface, (Item11_rect.x+20 , Item11_rect.y +100))

        text12_surface = font3.render(Item12, True, (0,0,0))
        screen.blit(text12_surface, (Item12_rect.x+20 , Item12_rect.y +100))
        
        #mouse position
        mx, my = pygame.mouse.get_pos()

        #This section of code was applied from a tutorial which I followed
        #It was used to allow me to create rectangular buttons although it was
        #heavily modified to add functionality to different buttons
        
#~~~~~~~~~~~~~~Start code applied from tutorial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  


#have each text box be represented in an array and check the array for the next empty bucket
        



        b_w = 180
        b_h = 70
        
        b2_x = 274
        b2_y = 562

        b3_x = 55
        b3_y = 200
        
        b4_x = 275
        b4_y = 200
        
        b5_x = 490
        b5_y = 200
       
        b6_x = 55
        b6_y = 290
        
        b7_x = 275
        b7_y = 290
        
        b8_x = 490
        b8_y = 290
       
        b9_x = 55
        b9_y = 380
        
        b10_x = 275
        b10_y = 380
       
        b11_x = 490
        b11_y = 380
       
        b12_x = 55
        b12_y = 470

        b13_x = 275
        b13_y = 470

        b14_x = 490
        b14_y = 470
         
    



        
        button_2 = pygame.Rect(b2_x, b2_y, b2_w, b2_h)
        
        button_3 = pygame.Rect( b3_x, b3_y ,b_w, b_h)
        button_4 = pygame.Rect( b4_x, b4_y ,b_w, b_h)
        button_5 = pygame.Rect( b5_x, b5_y ,b_w, b_h)
        button_6 = pygame.Rect( b6_x, b6_y ,b_w, b_h)
        button_7 = pygame.Rect( b7_x, b7_y ,b_w, b_h)
        button_8 = pygame.Rect( b8_x, b8_y ,b_w, b_h)
        button_9 = pygame.Rect( b9_x, b9_y ,b_w, b_h)
        button_10 = pygame.Rect( b10_x, b10_y ,b_w, b_h)
        button_11 = pygame.Rect( b11_x, b11_y ,b_w, b_h)
        button_12 = pygame.Rect( b12_x, b12_y ,b_w, b_h)
        button_13 = pygame.Rect( b13_x, b13_y ,b_w, b_h)
        button_14 = pygame.Rect( b14_x, b14_y ,b_w, b_h)

        #if Item1 == '':
         #  empty1 = true
#        Item2 = ''
#        Item3 = ''
#        Item4 = ''
#        Item5 = ''
#        Item6 = ''
#        Item7 = ''
#        Item8 = ''
#        Item9 = ''
#        Item10 = ''
#        Item11 = ''
#        Item12 = ''
        found = False
        """"for x in range (1,12):
            if found == False:
                varName = "Item"+str(x)            
                v = globals()[varName]
                print(v)
                if v == '':
                    found = True
                    Empty_row = v
                    print("called")
                    print(Empty_row)

                else:
                    x=x+1
            
                #print(f"{varName} is empty")"""

        if Item1 == '':
            Empty_row = 1
        elif Item2 == '':
            Empty_row = 2
        elif Item3 == '':
            Empty_row = 3
        elif Item4 == '':
            Empty_row = 4
        elif Item5 == '':
            Empty_row = 5
        elif Item6 == '':
            Empty_row = 6
        elif Item7 == '':
            Empty_row = 7
        elif Item8 == '':
            Empty_row = 8
        elif Item9 == '':
            Empty_row = 9
        elif Item10 == '':
            Empty_row = 10
        elif Item11 == '':
            Empty_row = 11
        elif Item12 == '':
            Empty_row = 12
        


        print(Empty_row)
        #What happens if the mouse click is over buttons listed above
      
        if button_2.collidepoint(mx, my):
            if click:
                print("button2")
                
                import CheckoutMenu

        if button_3.collidepoint(mx, my):
            if click:
               # if (f"Scrunchie1            {sc1_num}    ${sc1_price}") in Item1:
                   # Item1 = Item1[:-50]
                    
#Try an array of strings
#when added/modified update array and reprint everything

#if that doesnt work have everything on the screen and have 0 qty and delete everything
#and reprint with new variables to the screen
                sc1_num = sc1_num+1
                sc1_price = sc1_price+15
                Item1 = (f"Scrunchie1            {sc1_num}    ${sc1_price}")
                print(" Button3")
               
        if button_4.collidepoint(mx, my):
            if click:
               
                    
                sc2_num = sc2_num+1
                sc2_price = sc2_price+15
                Item2 = (f"Scrunchie2            {sc2_num}    ${sc2_price}")
                print(" Button4")
               
        if button_5.collidepoint(mx, my):
            if click:
                if (f"Scrunchie3            {sc3_num}    ${sc3_price}") in Item3:
                    Item3 = Item3[:-50]
                    

                sc3_num = sc3_num+1
                sc3_price = sc3_price+15
                Item3 = Item3 + (f"Scrunchie3            {sc3_num}    ${sc3_price}")
                 
                print(" Button5")
               
        if button_6.collidepoint(mx, my):
            if click:
                if (f"Scrunchie4            {sc4_num}    ${sc4_price}") in Item4:
                    Item4 = Item4[:-100]
                    

                sc4_num = sc4_num+1
                sc4_price = sc4_price+15
                Item4 = Item4 + (f"Scrunchie4            {sc4_num}    ${sc4_price}")
            
                print(" Button6")
               
        if button_7.collidepoint(mx, my):
            if click:
                if (f"Scrunchie5            {sc5_num}    ${sc5_price}") in Item5:
                    Item5 = Item4[:-100]
                    

                sc5_num = sc5_num+1
                sc5_price = sc5_price+15
                Item5 = Item5 + (f"Scrunchie5            {sc5_num}    ${sc5_price}")
                print(" Button7")
               
        if button_8.collidepoint(mx, my):
            if click:
                if (f"Shirt6            {sc6_num}    ${sc6_price}") in Item6:
                    Item6 = Item6[:-100]
                    

                sc6_num = sc6_num+1
                sc6_price = sc6_price+15
                Item6 = Item6 + (f"Shirt6            {sc6_num}    ${sc6_price}")
                print(" Button8")
               
        if button_9.collidepoint(mx, my):
            if click:
                if (f"Scrunchie7            {sc7_num}    ${sc7_price}") in Item7:
                    Item7 = Item7[:-100]
                    

                sc7_num = sc7_num+1
                sc7_price = sc7_price+15
                Item7 = Item7 + (f"Scrunchie7            {sc7_num}    ${sc7_price}")
                print(" Button9")
               
        if button_10.collidepoint(mx, my):
            if click:
                if (f"Scrunchie8            {sc8_num}    ${sc8_price}") in Item8:
                    Item8 = Item8[:-100]
                    

                sc8_num = sc8_num+1
                sc8_price = sc8_price+15
                Item8 = Item8 + (f"Scrunchie8            {sc8_num}    ${sc8_price}")
                print(" Button10")
               
        if button_11.collidepoint(mx, my):
            if click:
                if (f"Scrunchie9            {sc9_num}    ${sc9_price}") in Item9:
                    Item9 = Item9[:-100]
                    

                sc9_num = sc9_num+1
                sc9_price = sc9_price+15
                Item9 = Item9 + (f"Scrunchie9            {sc9_num}    ${sc9_price}")
                print(" Button11")
        if button_12.collidepoint(mx, my):
            if click:
                if (f"Scrunchie10            {sc10_num}    ${sc10_price}") in Item10:
                    Item10 = Item10[:-100]
                    

                sc10_num = sc10_num+1
                sc10_price = sc10_price+15
                Item10 = Item10 + (f"Scrunchie10            {sc10_num}    ${sc10_price}")
                print(" Button12")
        if button_13.collidepoint(mx, my):
            if click:
                if (f"Scrunchie11            {sc11_num}    ${sc11_price}") in Item11:
                    Item11 = Item11[:-100]
                    

                sc11_num = sc11_num+1
                sc11_price = sc11_price+15
                Item11 = Item11 + (f"Scrunchie11            {sc11_num}    ${sc11_price}")
                print(" Button13")
        if button_14.collidepoint(mx, my):
            if click:
                if (f"Scrunchie12            {sc12_num}    ${sc12_price}") in Item12:
                    Item12 = Item12[:-100]
                    

                sc12_num = sc12_num+1
                sc12_price = sc12_price+15
                Item12 = Item12 + (f"Scrunchie12            {sc12_num}    ${sc12_price}")
                print(" Button14")
        Total_Items = sc1_price + sc2_price + sc3_price + sc4_price + sc5_price + sc6_price + sc7_price + sc8_price + sc9_price + sc10_price + sc11_price + sc12_price
        Total_Qty = sc1_num + sc2_num + sc3_num + sc4_num + sc5_num + sc6_num + sc7_num + sc8_num + sc9_num + sc10_num + sc11_num + sc12_num

     
        
        text_surface_Cart = font.render("Cart", True, (0,0,0))
        text_surface_Item = font.render( "Item                         Qty      Price", True, (0,0,0))
        screen.blit(text_surface_Cart, (790,50))
        screen.blit(text_surface_Item, (790, 100))

        #for Button 2
        text_surface_Enter = font2.render("Enter", True, (0,0,0))
        screen.blit(text_surface_Enter, pygame.Rect((280, 565), (120, 70)))
                                          

        text_surface_Items = font.render(f"${Total_Items}", True, (0,0,0))
        screen.blit(text_surface_Items, pygame.Rect((1110, 530), (120, 70)))
        text_surface_Enter = font.render(f"{Total_Qty}", True, (0,0,0))
        screen.blit(text_surface_Enter, pygame.Rect((1022, 530), (120, 70)))

        
        #Cart
        pygame.draw.rect(screen,Colour,pygame.Rect(780,30,400,550),2)
        #button 2; Enter
        pygame.draw.rect(screen, Colour , button_2, 2)
        #Draw boxes for the number buttons
        pygame.draw.rect(screen, Colour, button_3, 2)
        pygame.draw.rect(screen, Colour, button_4, 2)
        pygame.draw.rect(screen, Colour, button_5, 2)
        pygame.draw.rect(screen, Colour, button_6, 2)
        pygame.draw.rect(screen, Colour, button_7, 2)
        pygame.draw.rect(screen, Colour, button_8, 2)
        pygame.draw.rect(screen, Colour, button_9, 2)
        pygame.draw.rect(screen, Colour, button_10, 2)
        pygame.draw.rect(screen, Colour, button_11, 2)
        pygame.draw.rect(screen, Colour, button_12, 2)
        pygame.draw.rect(screen, Colour, button_13, 2)
        pygame.draw.rect(screen, Colour, button_14, 2)

        screen.blit((font3.render("Scrunchie1", True, (0,0,0))),(b3_x+20, b3_y+15))
        screen.blit((font3.render("Scrunchie2", True, (0,0,0))),(b4_x+20, b4_y+15))
        screen.blit((font3.render("Scrunchie3", True, (0,0,0))),(b5_x+20, b5_y+15))
        screen.blit((font3.render("Scrunchie4", True, (0,0,0))),(b6_x+20, b6_y+15))
        screen.blit((font3.render("Scrunchie5", True, (0,0,0))),(b7_x+20, b7_y+15))
        screen.blit((font3.render("Shirt6", True, (0,0,0))),(b8_x+20, b8_y+15))
        screen.blit((font3.render("Shirt7", True, (0,0,0))),(b9_x+20, b9_y+15))
        screen.blit((font3.render("Shirt8", True, (0,0,0))),(b10_x+20, b10_y+15))
        screen.blit((font3.render("Shirt9", True, (0,0,0))),(b11_x+20, b11_y+15))
        screen.blit((font3.render("Pants10", True, (0,0,0))),(b12_x+20, b12_y+15))
        screen.blit((font3.render("Pants11", True, (0,0,0))),(b13_x+20, b13_y+15))
        screen.blit((font3.render("Pants11", True, (0,0,0))),(b14_x+20, b14_y+15))
       
#~~~~~~~~~~~~~~~~~~ End Code applied from tutorial~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
        

        ButtonBolt = pygame.image.load("LionsHEAD.png")
        ButtonBolt = pygame.transform.scale(ButtonBolt, (120, 120))
        screen.blit(ButtonBolt, (20,15))

            

        text_surface_LeVOGUE = font2.render("LeVOGUE", True, (0,0,0))
        screen.blit(text_surface_LeVOGUE, (140,55))


        Key_Rect = pygame.Rect(260, 125, 230, 40)
        pygame.draw.rect(screen, (0,0,0) , Key_Rect, 2)

        
        Left_select_Rect = pygame.Rect(208, 125, 40, 40)
        pygame.draw.rect(screen, (0,0,0), Left_select_Rect , 2)

        text_surface_Left_select = font2.render("<", True, (0,0,0))
        screen.blit(text_surface_Left_select, (215,118))

        Right_select_Rect = pygame.Rect(502, 125, 40, 40)
        pygame.draw.rect(screen, (0,0,0), Right_select_Rect , 2)

        text_surface_Left_select = font2.render(">", True, (0,0,0))
        screen.blit(text_surface_Left_select, (510,118))
        



        


        
        #CART
        pygame.draw.rect(screen,Colour,pygame.Rect(780,30,400,550),2)


        
        
        
        click = False
        #update screen

        pygame.display.update()
        pygame.display.flip()
        mainClock.tick(60)

    



#The following code was derived from a tutorial which allows the application
#to quit without causing any error codes. 

#~~~~~~~~~~~~Start code applied from tutorial~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def Quit():
    running = True
    while running:
        pygame.quit()
        quit()
#~~~~~~~~~~~ End Code applied from tutorial~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        

        

#run the main menu
Main_sales()
pygame.quit()
sys.exit()



#窗口----------------------------------------
"""
此文件是调用所有其他文件(包括
充分应用。
"""
#以下导入是预先编写的模块
#我能够使用的函数。他们是预先下载的
#使用python以及从pygame.org下载一些
导入pygame,sys
从集合导入计数器作为计数
从日期时间导入日期时间
导入时间
导入字符串
#导入读取
mainClock=pygame.time.Clock()
#设置窗口
从pygame.locals导入*
#以下是此处定义的常数,以便于维护
点击=布尔
pygame.init()
pygame.display.set_标题('LeVOGUE'))
clock=pygame.time.clock()
screen=pygame.display.set_模式((1200,800),0,32)
windowSurface=pygame.display.set_模式((1200650),pygame.DOUBLEBUF)
运行=2
font=pygame.font.SysFont(无,35)
font2=pygame.font.SysFont(无,70)
font3=pygame.font.SysFont(无,25)
base\u font=pygame.font.font(无,50)
base_font2=pygame.font.font(无,160)
第1项=“”
第2项=“”
第3项=“”
第4项=“”
第5项=“”
第6项=“”
第7项=“”
第8项=“”
第9项=“”
第10项=“”
第11项=“”
第12项=“”
Item1_rect=pygame.rect(78033400547)
Item2_rect=pygame.rect(780,58400547)
Item3_rect=pygame.rect(78083400547)
Item4_rect=pygame.rect(780108400547)
Item5_rect=pygame.rect(780133400547)
Item6_rect=pygame.rect(780158400547)
Item7_rect=pygame.rect(780183400547)
Item8_rect=pygame.rect(780208400547)
Item9_rect=pygame.rect(780233400547)
Item10_rect=pygame.rect(780258400547)
Item11_rect=pygame.rect(780283400547)
Item12_rect=pygame.rect(780308400547)
行=1
颜色=pygame.Color(0,0,0)
发现=错误
#键\文本\数量=2
s=“”
fh=打开(“user_info.txt”,“r”)
keys=pygame.key.get_pressed()
单击=pygame.MOUSEBUTTONDOWN
音量=真
活动=错误
#勾选激活