You should do it as:
path=[1,2,3,4,5]
return str(path)
문제
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)