 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
Bazza LXF regular

Joined: Sat Mar 21, 2009 11:16 am Posts: 1381 Location: Loughborough
|
Posted: Sun Dec 04, 2011 2:24 pm Post subject: |
|
|
Not really studied the code except to say......
Check all of your single quotes as they look wrong they should be
| Code: | | "characters" or 'characters' |
_________________ 73...
Bazza, G0LCU...
Team AMIGA... |
|
| Back to top |
|
 |
evilnick Moderator

Joined: Mon Apr 04, 2005 12:47 pm Posts: 151 Location: LXF towers
|
Posted: Sat Jan 07, 2012 11:23 pm Post subject: |
|
|
The underscore characters you are using (I think just for effect) are unicode. You either need to define a unicode encoding at the top of the file or change them for something else like '-'. All the quotes look wrong, as has been mentioned.
also the if __name__ = '__main__' bit is the main executable code in the file, so it shouldn't be indented like that, you have it as part of the main() function, but actually it is the bit that invokes the main() function:
| Code: |
from django.utils.encoding import smart_str, smart_unicode
import twitter
CusKey = "XX"
CusSec = "XXX"
AccTokKey = "XXXX"
AccTokKeySec = "XXXXX"
def main():
api = twitter.Api(consumer_key = CusKey, consumer_secret = CusSec, access_token_key = AccTokKey, access_token_secret = AccTokKeySec)
timeline = api.GetFriendsTimeline()
for status in timeline:
print status.user.name.encode('ascii', 'ignore'), '----', status.text.encode('ascii', 'ignore')
if __name__ == '__main__':
main()
|
|
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|