python - Displaying a list as string -


i pretty new python, , writing code program queries , displays map image id's satellite images.

the images compiled list, , print list string, new lines between each image id. image id's saved separate entries in list, when try

print result list_ = result list_as_json = json.dumps(list_) mybigstring = "\n".join(list_as_json) print mybigstring     

or

mybigstring = "" s in list_as_json:  mybigstring = mybigstring + "\n" + s print mybigstring 

it ends printing every letter id on different line. so, instead of printing like:

landsat/le7_l1t/le70160402014017edc00
landsat/le7_l1t/le70160402014033edc00
landsat/le7_l1t/le70160402014049edc00
landsat/le7_l1t/le70160412014017edc00
landsat/le7_l1t/le70160412014033edc00
landsat/le7_l1t/le70160412014049edc00

it prints:

l

n
d
s

t
/
l
e
7
_
l
1
etc.

if enter

print list_as_json

i get:

["landsat/le7_l1t/le70160402014017edc00", "landsat/le7_l1t/le70160402014033edc00", "landsat/le7_l1t/le70160402014049edc00", "landsat/le7_l1t/le70160412014017edc00", "landsat/le7_l1t/le70160412014033edc00", "landsat/le7_l1t/le70160412014049edc00"]

any words of wisdom?

your python script works correct - have string, not list , iterates on chars

show how create list variable more concrete

you can try split string list , print way do


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -