strings = ['\n'] vtypes_str = ''' ''' strings.append(vtypes_str) routes_str = ''' ''' strings.append(routes_str) departs = [f'{d:03}' for d in range(0, 600, 20)] routes = ["LR_below", "RL_below", "LR_upper", "LR_below", "LR_below", "LR_upper_lt"] vehicles_str = '' print(departs) vehicles_str = ''' ''' strings.append(vehicles_str) strings.append('') strings = ''.join(strings) # route.rou.xml 파일 저장 with open('sn_routes.rou.xml', 'w') as f: f.write(strings)