print'Personal information, journal and more to come'
x = raw_input()
if x ==("Personal Information"): # wont print
print' Edward , Height: 5,10 , EYES: brown , STATE: IL TOWN: , SS:'
elif x ==("Journal"): # wont print
read = open('C:\\python\\foo.txt' , 'r')
name = read.readline()
print (name)
我启动程序和"Personal information, journal and more to come"
节目,但是当我输入任一Personal information
或它们的journal neither
打印出结果,我没有得到任何错误。如果和ELIF不打印
呃我认为我需要一个更好的解释我是一个初学者在实际脚本中看起来像什么?你是否想让我的文件中的文字小写?什么是吧 – 2012-07-30 21:21:59
这些神秘的物体是什么'foo'和'bar'? O.o @EdwardLaPiere:foo和bar只是示例变量。你可以将它们替换为你真正感兴趣比较的任何对象。 – 2012-07-30 21:25:37
还有一个问题,我如何循环代码,所以我可以继续输入两个选项与出错获得一些未定义的东西? – 2012-07-30 21:28:42