Web site set up to use spinach and spinach platform function argument to a function called repeatedly

Original Abstract: spinach and spinach website function argument to build a platform for repeatedly calling a function using the method detailed
spinach website function parameters BCfrom sys import argv # sys.argv using the parameters passed, argv is a BC network parameter list 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

Open with (file_name) AS language_file:
main (language_file, input_encoding,
errors) ----------------
spinach platform to build a function called repeatedly use the detailed method

Guess you like

Origin blog.51cto.com/14259671/2474151