Re: [Tutor] Regular expression

2014-09-23 Thread Steven D'Aprano
On Tue, Sep 23, 2014 at 11:40:25AM +0200, jarod...@libero.it wrote: > Hi there!! > > I need to read this file: > > pippo.count : > 10566 ZXDC >2900 ZYG11A >7909 ZYG11B >3584 ZYX >9614 ZZEF1 > 17704 ZZZ3 > How can extract only the number and the work in array? Thanks for any he

[Tutor] Regular expression

2014-09-23 Thread jarod...@libero.it
Hi there!! I need to read this file: pippo.count : 10566 ZXDC 2900 ZYG11A 7909 ZYG11B 3584 ZYX 9614 ZZEF1 17704 ZZZ3 This file present a use space on the begin then they have a number and the a word. p =re.compile("\s+\d+") with open("pippo.count") as p: for i in p:

Re: [Tutor] print date and skip any repeats

2014-09-23 Thread Dave Angel
Please post in text mode, not html. questions anon Wrote in message: > > lastdate=all_the_dates[1] > onedateperday.append(lastdate) > print onedateperday > for date in all_the_dates: > if date !=lastdate: > lastdate=date > onedateperday.append(lastdate) There are a numbe