原创摘要:菠菜网站函数参数传入和菠菜平台重复调用函数的搭建使用详细方法
菠菜网站函数参数BCfrom sys import argv#利用sys.argv传入参数,argv是一个BC网参数列表list
script,file_name,input_encoding,errors = argv
def main(language_file,encoding,errors):#主函数参数
print(">>>>main",repr(language_file),encoding,errors)
line = language_file.readline()
if line:
print(">>there is a line:",repr(line))
print_line(line,encoding,errors)#调用子函数
print(">>calling main again")
return main(language_file,encoding,errors)#返回调用主函数
print(">>>>exit main")
def print_line(line,encoding,errors):
print("print line",repr(line),encoding,errors)
next_lan = line.strip()
return next_lan
with open(file_name) as language_file:
main(language_file,input_encoding,errors)
————————————————
菠菜平台重复调用函数的搭建使用详细方法
原文地址:https://blog.51cto.com/14259671/2474151
时间: 2024-11-07 21:45:56