python
import saved as s
try:
print(s.read("t.ttt"))
except:
while True:
a = input("language(china/english:)")
if a == "china" or a == "China" or a == "CHINA":
s.write("t.ttt")
s.write("china.cn")
break
elif a == "english" or a == "English" or a == "ENGLISH":
s.write("t.ttt")
s.write("eng.cn")
break
else:
print("Re-enter")
try:
s.read("china.cn")
try:
print(s.read("w.china"))
except:
y = input("邮箱:")
m = input("密码:")
s.write("w.china", "邮箱:"+y+"\t"+"密码:"+m)
except:
s.read("eng.cn")
try:
print(s.read("w.eng"))
except:
y = input("mail:")
m = input("password:")
s.write("w.eng", "mail:"+y+"\t"+"password:"+m)
saved.py:
def write(file,text):
w=open(file,"w")
w.write(text)
def read(file):
r=open(file,"r")
return r.read()
运行结果:
File "C:\Users\Public\TurtleWorkspace\elwhy\main.py", line 7
if a == "china" or a == "China" or a == "CHINA":
^
IndentationError: unexpected indent