python Printing One result per line -


i show below part of working script verify twitter accounts giving me results want 1 besides other, while want have them 1 per line including title of find

example, first 3 result followers, how many others being followed, , in how many lists user in, , giving me results in 1 line this:

1350 257 27 , want follows

followers:1,350

following: 257

number of lists present: 27

i tried use " ; " commas, "/n " ; either not work or gives me 500 error

here script

all nice

thank you

................

details = twitter.show_user(screen_name='xxxxxx')   print "content-type: text/html;charset=utf-8" print print"<html><head></head><body>"  print (details['followers_count']) #followers print (details['friends_count'])# following  print (details['listed_count'])# in how many lists   ...    .... 

instead of last 3 print lines, use string formatting pass in values.

print "followers:{}\nfollowing: {}\nnumber of lists present: {}".format(     details['followers_count'], details['friends_count'], details['listed_count'] ) 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -