为什么控制台要求在PYTHON中选择任何选项后都不显示

2024-04-27 03:01:00 发布

您现在位置:Python中文网/ 问答频道 /正文

CODEOUTPUT

在输出的程序,我已附加在图像2后控制台要求选项选择之前,我输入任何东西控制台无显示,但我的程序运行良好,如何摆脱这个没有;请参考我所附的图片

from PIL import Image
image1=Image.open("chinu.jpg")
r,g,b=image1.split()

def red() :
    r.show()
def green() :
    g.show()
def blue() :
    b.show()

options = {1 : red,
           2 : green,
           3 : blue,
        }
while True:
    print(" 1-->  red   channel")
    print(" 2-->  green channel")
    print(" 3-->  blue  channel")
    num = int(input(print("enter your choice here = ")))
    options[num]()
    quits = str(input(print("IF YOU WANT TO CONTINUE PRESS Y  or press any key to quit")))
    if quits is "Y":
        continue
    else:
        break

Tags: imageinputoutputdefshowchannelcodegreen