User:Crowley666/code/navbox工具.py
外观
lang = 'en'
def g(a, b):
x = a.split(' ', 1)[0]
ay = a.split(' ', 1)[1]
by = b.split(' ', 1)[1]
if ay[0] != '[':
return b
elif by[0] != '[':
return "%s {{tsl|%s|%s|%s}}" % (x, lang, ay[2:-2], by)
else:
return b
def f(a, b):
al = [x for x in a.split('\n') if x]
bl = [x for x in b.split('\n') if x]
print('\n'.join(list(map(g, al, bl))))