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
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', u'Alpa
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
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
go
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
https://groups.google.com/d
>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,
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 wrote:
> 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 d
You don't need to import Sets in Python 2.5.
-Nick
On Tue, Nov 15, 2011 at 2:51 AM, Tim Hoffman 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
>
> Th
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', show_