刚学习python 请问这个小程序怎么错了QAQ
#!/usr/bin/python
#coding=utf-8
yes="yes"
no="no"
from sys import argv
Youself,pake1,pake2=argv
talking="这是一个文件比较脚本"
print talking
print """
我现在自己在文件的> %r
第一个文件在文件的> %r
第二个文件在文件的> %r
""" %(Youself,pake1,pake2)
yesorno=input("请问要继续比较吗(Yes or No)> ")
if yesorno==yes:
print "比较中......"
try:
first=open(pake1)
nest=open(pake2)
except IOError:
print "文件打开失败"
else:
print "文件打开成功"
fin=first.read()
fin2=nest.read()
if fin == fin2:
print "文件一样"
first.close()
nest.close()
else:
print "文件不一样"
first.close()
nest.close()
elif yesorno==no:
print "输入正确退出"
else:
print "请输入yes/no"
#!/usr/bin/python
#coding=utf-8
yes="yes"
no="no"
from sys import argv
Youself,pake1,pake2=argv
talking="这是一个文件比较脚本"
print talking
print """
我现在自己在文件的> %r
第一个文件在文件的> %r
第二个文件在文件的> %r
""" %(Youself,pake1,pake2)
yesorno=input("请问要继续比较吗(Yes or No)> ")
if yesorno==yes:
print "比较中......"
try:
first=open(pake1)
nest=open(pake2)
except IOError:
print "文件打开失败"
else:
print "文件打开成功"
fin=first.read()
fin2=nest.read()
if fin == fin2:
print "文件一样"
first.close()
nest.close()
else:
print "文件不一样"
first.close()
nest.close()
elif yesorno==no:
print "输入正确退出"
else:
print "请输入yes/no"