Python Forum
How to convert a Status object to String?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to convert a Status object to String?
#5
(Jan-14-2018, 08:24 AM)Gribouillis Wrote: You can try print(dir(s)) to see if s has a method converting to a string.

Just tried that out and got this for the output,
['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getstate__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_api', '_json', 'author', 'contributors', 'coordinates', 'created_at', 'destroy', 'entities', 'favorite', 'favorite_count', 'favorited', 'geo', 'id', 'id_str', 'in_reply_to_screen_name', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'in_reply_to_user_id', 'in_reply_to_user_id_str', 'is_quote_status', 'lang', 'parse', 'parse_list', 'place', 'retweet', 'retweet_count', 'retweeted', 'retweets', 'source', 'source_url', 'text', 'truncated', 'user']
I notice there is __str__ would that be any help? If so how would I use it?
Reply


Messages In This Thread
RE: How to convert a Status object to String? - by Vucko - Jan-14-2018, 05:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  convert address and broadcast to network object Skaperen 9 2,029 Mar-09-2023, 06:55 PM
Last Post: Skaperen
  convert string to float in list jacklee26 6 2,180 Feb-13-2023, 01:14 AM
Last Post: jacklee26
  Review my code: convert a HTTP date header to a datetime object stevendaprano 1 2,235 Dec-17-2022, 12:24 AM
Last Post: snippsat
  how to convert tuple value into string mg24 2 2,625 Oct-06-2022, 08:13 AM
Last Post: DeaD_EyE
  Convert string to float problem vasik006 8 3,713 Jun-03-2022, 06:41 PM
Last Post: deanhystad
  Convert a string to a function mikepy 8 2,759 May-13-2022, 07:28 PM
Last Post: mikepy
Question How to convert string to variable? chatguy 5 2,801 Apr-12-2022, 08:31 PM
Last Post: buran
  Convert string to int Frankduc 8 2,750 Feb-13-2022, 04:50 PM
Last Post: menator01
  Convert string to path using Python 2.7 tester_V 10 6,802 Nov-20-2021, 02:20 PM
Last Post: snippsat
  Convert each element of a list to a string for processing tester_V 6 5,619 Jun-16-2021, 02:11 AM
Last Post: tester_V

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020