Re: [google-appengine] Re: Can I use set in Appengine?

2011-11-15 Thread Max
I don't know, but still not working. (I'm working in coderbuddy.com). This my code: class MainHandler(webapp.RequestHandler): def get(self): tweetlist=[] appo=[] for i in range(1, 16): public_tweets = tweepy.api.search(q='#asroma', rpp=100, lang='it',

[google-appengine] Re: Can I use set in Appengine?

2011-11-15 Thread pdknsk
Unlike sort(), sorted() doesn't sort in place, but returns the result. -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to

[google-appengine] Re: Can I use set in Appengine?

2011-11-15 Thread Max
Thanks, your post is really great. After reading it I solve like this: tweetlist = sorted(set(tweetlist)) Really thanks! -- You received this message because you are subscribed to the Google Groups Google App Engine group. To view this discussion on the web visit

[google-appengine] Re: Can I use set in Appengine?

2011-11-14 Thread Tim Hoffman
Hi If your using Python 2.5 then you need to import the sets module. from sets import Set Set([1,2,1,2,4]) Set([1, 2, 4]) This code will also work in 2.7 Though in 2.7 you have the set type builtin. Rgds Tim -- You received this message because you are subscribed to the Google Groups

[google-appengine] Re: Can I use set in Appengine?

2011-11-14 Thread Max
It's not working for me. The code: from sets import Set (..) Set(tweetlist) tweetlist.sort() print tweetlist The results: [u'1001storieRoma', u'3zoOozq8', u'6PierC9', u'ABelal10', u'ASRoma_1927', u'ASRoma_1927', u'ASRoma_1927', u'AcoSoegono', u'AdiCuur', u'AdistaAdinda', u'AleSCCP',

[google-appengine] Re: Can I use set in Appengine?

2011-11-14 Thread pdknsk
http://shell.appspot.com/ set([1,2,3,4,5,1,2]) set([1, 2, 3, 4, 5]) -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to

Re: [google-appengine] Re: Can I use set in Appengine?

2011-11-14 Thread Matt Jibson
From http://docs.python.org/library/stdtypes.html#set-types-set-frozenset: A set object is an unordered collection You can use set() to filter out duplicates. But then you need to convert back to a list to be able to sort: result = sorted(list(set(tweetlist))) On Mon, Nov 14, 2011 at 2:22 PM,

Re: [google-appengine] Re: Can I use set in Appengine?

2011-11-14 Thread Matt Jibson
To improve my previous post: no need to use list(). You can do sorted(set(tweetlist)). On Mon, Nov 14, 2011 at 2:29 PM, Matt Jibson matt.jib...@gmail.com wrote: From http://docs.python.org/library/stdtypes.html#set-types-set-frozenset: A set object is an unordered collection You can use set()

Re: [google-appengine] Re: Can I use set in Appengine?

2011-11-14 Thread Nick Johnson
You don't need to import Sets in Python 2.5. -Nick On Tue, Nov 15, 2011 at 2:51 AM, Tim Hoffman zutes...@gmail.com wrote: Hi If your using Python 2.5 then you need to import the sets module. from sets import Set Set([1,2,1,2,4]) Set([1, 2, 4]) This code will also work in 2.7