我试图让它,这样用户可以创建文本艺术和名称,然后他们喜欢,然后当他们进入艺术名单上,他们可以看到他们的艺术名称,并显示它。现在我有了这个:
#
#Text Art Thing
#15/05/2015
#By Dom
while True:
UserInput = input("##################################################\n1 - Create new art\n2 - Manage saved art\n3 - Watch a slideshow of all the art\n##################################################\n\n")
Art = []
def NewArt():
stop = False
x = input("What would you like to call your art? ")
vars()[x] = []
ln = 1
while stop == False :
inputln = input("" + str(ln) + ") ")
if inputln == "end" :
stop = True
print("You have exited the editor. Your art is shown below!\n##################################################\n")
print("\n".join(vars()[x]))
print("\n##################################################\n")
Art.append(vars()[x])
ln += 1
vars()[x].append(inputln)
if UserInput == "1" :
print("Loading...")
NewArt()
if UserInput == "2" :
print("Loading...")
SavedArt()
if UserInput == "3" :
print("Loading...")
SlideArt()
这可以创造多个艺术精品,但我只有这样,然后我在艺术类型:
[['Cat1', 'Cat2', 'end']]
名称不显示键入Cat只会出错。你知道吗
希望你能帮忙。你知道吗
您可以在Python dict中存储所有艺术,将每个“图像”(ASCII艺术字符串)与一个名称相关联。你知道吗
示例:
相关问题 更多 >
编程相关推荐