문제

I'm writing a TSP algorithm using python and the output is a list of node route like : path [1,2,3,4,5] where each number is a key of city name. now i need to retrieve the whole list in browser but i can't because i only get one value from the list when i use return path note : my code is running perfectly since the output appear in console window. any ideas ??

simple example :

file.py
def temp():
path=[1,2,3,4,5]
return path

file.html
{{extend 'layout.html'}}
<h1>{{=path}}</h1>
도움이 되었습니까?

해결책

You should do it as:

path=[1,2,3,4,5]
return str(path)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top