On Tue, 12 Apr 2011 22:11:55 +0300
Yuri Slobodyanyuk wrote:
> Thanks for the insight, while this code will run once a week and
> optimization isn't really a must here, it is
> still a good idea not to leave half-baked code behind me, especially given
> that it will be running on this server for
Thanks for the insight, while this code will run once a week and
optimization isn't really a must here, it is
still a good idea not to leave half-baked code behind me, especially given
that it will be running on this server for the next 13 years ;)
I have one doubt though . Doesn't using the lis
On Tue, 12 Apr 2011 15:06:25 +0300
Yuri Slobodyanyuk wrote:
> Thanks everybody , and especially Chris - i used split and it took me 15
> mins to make it work :)
That's great. One thing though...
> for nnn in hhh:
> if nnn.split()[2] == str(time_tuple[1]).strip(' \t\n\r') and
> nnn.split()
Thanks everybody , and especially Chris - i used split and it took me 15
mins to make it work :)
The final version looks like:
from datetime import datetime, date, time
today_day = datetime.now()
time_tuple= today_day.timetuple()
hhh = open("file_with_data.data",'r')
for nnn in hhh:
if nnn.sp
On Mon, Apr 11, 2011 at 10:20 PM, Yuri Slobodyanyuk
wrote:
> Good day everyone,
> I am trying to make this pretty simple regex to work but got stuck,
> I'd appreciate your help .
"Some people, when confronted with a problem, think 'I know, I'll use
regular expressions.' Now they have two problems
On Mon, Apr 11, 2011 at 10:20 PM, Yuri Slobodyanyuk
wrote:
> Good day everyone,
> I am trying to make this pretty simple regex to work but got stuck,
> I'd appreciate your help .
> Task: Get current date , then read file of format below, find the line that
> matches
> the current date of month,mon
On Tue, Apr 12, 2011 at 10:50 AM, Yuri Slobodyanyuk
wrote:
> Good day everyone,
> I am trying to make this pretty simple regex to work but got stuck,
> I'd appreciate your help .
> Task: Get current date , then read file of format below, find the line that
> matches
> the current date of month,mon
Good day everyone,
I am trying to make this pretty simple regex to work but got stuck,
I'd appreciate your help .
Task: Get current date , then read file of format below, find the line that
matches
the current date of month,month and year and extract the number from such
line.
Here is what I did ,