편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2020.05.11

    파이썬 가위바위보


    from tkinter import *
    
    import random
    
    
    com = {'가위','바위','보'}
    
    user = {'가위', '바위', '보'}
    
    
    def rcp_game( ) :
    
    
    
        com = random.choice(['가위', '바위', '보'])
        user =(['가위', '바위', '보'])
    
        if   (user=='가위' and com=='보') or (user=='바위' and com =='가위')or(user=='보' and com=='바위') :
            lbl2.configure(text="사용자 승")
            lbl3 = Label(root, image = photo1)
            lbl3.place(x=100, y=30) 
        elif (user=='가위' and com=='가위') or (user=='바위' and com =='바위') or(user=='보' and com=='보') :
            lbl2.configure(text="무승부")
            lbl3 = Label(root, image = photo2)
            lbl3.place(x=100, y=30)
        elif (user=='가위' and com=='바위') or (user=='바위' and com =='보') or(user=='보' and com=='가위') :
            lbl2.configure(text="컴퓨터 승")
            lbl3 = Label(root, image = photo3)
            lbl3.place(x=100, y=30)
        else:
            lbl2.configure(text="다시 입력")
            lbl3 = Label(root, image = photo2)
            lbl3.place(x=100, y=30)
    
    root = Tk()
    root.title("가위바위보")
    root.geometry("230x120")
    
    photo1 = PhotoImage(file = "smile.png")
    
    photo2 = PhotoImage(file = "try.png")
    
    photo3 = PhotoImage(file = "cry.png")
    
    
    
    lbl1 =Label(root, text="사용자")
    
    ent =Entry(root)
    
    lbl2 = Label(root, text ="승패결과")
    
    btn = Button(root, text = "확인", command= rcp_game)
    
    lbl1.place(x= 10, y=10)
    
    
    
    ent.place(x=50, y=10)
    btn.place(x=50, y=40)
    lbl2.place(x=50, y=80)
    
    root.mainloop()
    

    여기서 else부분만 실행이 돼요. 그냥 프로그램 작동이 안 한다는 소리겠죠. 왜 그럴까요?

  • 프로필 엽토군님의 편집
    날짜2020.05.10

    파이썬 가위바위보


    from tkinter import *
    
    import random
    
    
    com = {'가위','바위','보'}
    
    user = {'가위', '바위', '보'}
    
    
    def rcp_game( ) :
    
    
    
        com = random.choice(['가위', '바위', '보'])
        user =(['가위', '바위', '보'])
    
        if   (user=='가위' and com=='보') or (user=='바위' and com =='가위')or(user=='보' and com=='바위') :
            lbl2.configure(text="사용자 승")
            lbl3 = Label(root, image = photo1)
            lbl3.place(x=100, y=30) 
        elif (user=='가위' and com=='가위') or (user=='바위' and com =='바위') or(user=='보' and com=='보') :
            lbl2.configure(text="무승부")
            lbl3 = Label(root, image = photo2)
            lbl3.place(x=100, y=30)
        elif (user=='가위' and com=='바위') or (user=='바위' and com =='보') or(user=='보' and com=='가위') :
            lbl2.configure(text="컴퓨터 승")
            lbl3 = Label(root, image = photo3)
            lbl3.place(x=100, y=30)
        else:
            lbl2.configure(text="다시 입력")
            lbl3 = Label(root, image = photo2)
            lbl3.place(x=100, y=30)
    
    root = Tk()
    root.title("가위바위보")
    root.geometry("230x120")
    
    photo1 = PhotoImage(file = "smile.png")
    
    photo2 = PhotoImage(file = "try.png")
    
    photo3 = PhotoImage(file = "cry.png")
    
    
    
    lbl1 =Label(root, text="사용자")
    
    ent =Entry(root)
    
    lbl2 = Label(root, text ="승패결과")
    
    btn = Button(root, text = "확인", command= rcp_game)
    
    lbl1.place(x= 10, y=10)
    
    
    
    ent.place(x=50, y=10)
    btn.place(x=50, y=40)
    lbl2.place(x=50, y=80)
    
    root.mainloop()
    

    여기서 else부분만 실ㅇ행이 돼요.. 그냥 프로그램 작동이 안 한다는 소리겠죠..왜 그럴까요 진짜 모르겠어요ㅠㅠ

  • 프로필 알 수 없는 사용자님의 편집
    날짜2020.05.10

    파이썬 가위바위보


    from tkinter import *

    import random

    com = {'가위','바위','보'}

    user = {'가위', '바위', '보'}

    def rcp_game( ) :

    com = random.choice(['가위', '바위', '보'])
    user =(['가위', '바위', '보'])
    
    if   (user=='가위' and com=='보') or (user=='바위' and com =='가위')or(user=='보' and com=='바위') :
        lbl2.configure(text="사용자 승")
        lbl3 = Label(root, image = photo1)
        lbl3.place(x=100, y=30) 
    elif (user=='가위' and com=='가위') or (user=='바위' and com =='바위') or(user=='보' and com=='보') :
        lbl2.configure(text="무승부")
        lbl3 = Label(root, image = photo2)
        lbl3.place(x=100, y=30)
    elif (user=='가위' and com=='바위') or (user=='바위' and com =='보') or(user=='보' and com=='가위') :
        lbl2.configure(text="컴퓨터 승")
        lbl3 = Label(root, image = photo3)
        lbl3.place(x=100, y=30)
    else:
        lbl2.configure(text="다시 입력")
        lbl3 = Label(root, image = photo2)
        lbl3.place(x=100, y=30)
    

    root = Tk() root.title("가위바위보") root.geometry("230x120")

    photo1 = PhotoImage(file = "smile.png")

    photo2 = PhotoImage(file = "try.png")

    photo3 = PhotoImage(file = "cry.png")

    lbl1 =Label(root, text="사용자")

    ent =Entry(root)

    lbl2 = Label(root, text ="승패결과")

    btn = Button(root, text = "확인", command= rcp_game)

    lbl1.place(x= 10, y=10)

    ent.place(x=50, y=10) btn.place(x=50, y=40) lbl2.place(x=50, y=80)

    root.mainloop()

    여기서 else부분만 실ㅇ행이 돼요.. 그냥 프로그램 작동이 안 한다는 소리겠죠..왜 그럴까요 진짜 모르겠어요ㅠㅠ