On Tue, Oct 4, 2011 at 10:03 PM, lina <lina.lastn...@gmail.com> wrote:
> > > On Tue, Oct 4, 2011 at 8:51 PM, <eire1...@gmail.com> wrote: > >> I don't understand what you want >> >> Mayybe give expected output as well >> > > want to do a statistic of the concurrence of E, > namely, > how many times the E showed up, > > so the first column is 1, second column and then following. > > Thanks, > > I have one, which showed something like: > > > > tokens=['E'] > > result=[] > filedata = open("try.xpm") > text=filedata.readlines() > > for line in text: > result.append({t:line.count(t) for t in tokens}) > > for index,r in enumerate(result): > print(index,"-----",r) > > The error message is: > > > result.append({t:line.count(t) for t in tokens}) > ^ > SyntaxError: invalid syntax > I made a mistake, it used python3 I wonder: can someone help me anatomy this one to help me understand, > > > >> >> Sent from my Verizon Wireless BlackBerry >> >> -----Original Message----- >> From: lina <lina.lastn...@gmail.com> >> Sender: tutor-bounces+eire1130=gmail....@python.org >> Date: Tue, 4 Oct 2011 19:44:02 >> To: tutor<Tutor@python.org> >> Subject: [Tutor] arrary stastic >> >> _______________________________________________ >> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor >> >> >> > > > -- > Best Regards, > > lina > > > -- Best Regards, lina
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor