Here's the link:
http://paste.debian.net/53933/
On Mon, Dec 14, 2009 at 6:10 AM, bibi midi wrote:
>
>
> Yes my bad, found out too late. Sorry for that. Will post in pastebin or
> equal and give the link.
>
>
> --
> Best Regards,
> bibimidi
On Mon, Dec 14, 2009 at 6:09 AM, bibi midi wrote:
>
>
> On Mon, Dec 14, 2009 at 1:17 AM, Rich Lovely wrote:
>
>>
>> First of all it's too long to paste into an email, especially if
>> you'rte using a client that strips leading whitespace. Paste it
On Mon, Dec 14, 2009 at 1:17 AM, Rich Lovely wrote:
>
> First of all it's too long to paste into an email, especially if
> you'rte using a client that strips leading whitespace. Paste it into
> a pastebin. I personally prefer python.codepad.org, as it lets you
> test code on the server, unless i
Thanks to all of you that replied. Your inputs are very helpful and
informative.
On Tue, Dec 1, 2009 at 12:14 AM, Sander Sweers wrote:
>
> There is no exception to alert you a file already exists. Depending on
> how you open the file (mode) it will either read, write or append to
> the file. If
-- Forwarded message --
From: bibi midi
Date: Tue, Nov 17, 2009 at 11:12 PM
Subject: Re: [Tutor] proxy switcher - was Re: I love python / you guys :)
To: Dave Angel
Cc: Luke Paireepinart , tutor
Hi guys!
Thank you all for the brainstorming. As much as i love to follow all
Hi guys!
Thank you all for the brainstorming. As much as i love to follow all your
tips but sorry I got lost in the sea of discussion :-) Therefore i thought i
start to roll out my own and i hope you guys can chime in.
The print lines in my code are just for debugging. Of course they can be
omitt
On Mon, Nov 16, 2009 at 1:58 AM, Stefan Lesicnik wrote:
> hi,
>
> Although not a question, i just want to tell you guys how awesome you are!
>
> I am not a programmer, i can do a bit of bash. I have never officially
> learnt programming, but numerous times looked at some perl, c, java
> and never
On Sun, Nov 15, 2009 at 10:37 AM, wesley chun wrote:
> >> My brother in law is learning python. He's downloaded 3.1 for
> >> Windows, and is having a play. It's already confused him that print
> >> "hello world" gives a syntax error
> >>
> >> He's an absolute beginner with no programming ex
On Sun, Nov 8, 2009 at 8:38 AM, Dave Angel wrote:
>
> You have the following line at top-level:
>
> if ask.lower not in reply:
>
> But you're not calling the method str.lower(), you're just creating a
> function object from it. You need those parentheses.
>
> if ask.lower() not in reply:
>
>
On Sun, Nov 8, 2009 at 6:20 AM, bibi midi wrote:
> Thank you all for the helpful insights. I will keep in mind the naming
> rules in Python, so as not to have it in collision with Python's
> builtins.
>
> The mention to tidy up e.g. "compartmentalize" code is al
On Sat, Nov 7, 2009 at 3:26 PM, Dave Angel wrote:
> Alan Gauld wrote:
>>
> Alan - Excellent comments, as usual.
>
> bibimidi - I would point out that after you remove the 'global choose'
line
> as Alan said, you should rename the global variable you're using to store
> the return value. They're a
Yep it works! I understand now it iterates on each line and replaces the old
elements with the new ones. In the end you get the latest date of the last
line of log.
I will work on the exception handling and other refinements. Thanks.
On Tue, Oct 27, 2009 at 8:41 AM, Christian Witts wrote:
>
>
s I'm away from my linux box atm.
for line in open(log_file):
last_log_date = ' '.join(line.split(' ')[:3])
Thanks.
On Tue, Oct 27, 2009 at 2:56 PM, Christian Witts wrote:
> bibi midi wrote:
>
>> #!/usr/bin/env python
>> # -*- coding: utf-8 -*-
>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Calculate internet data consumption
of service provider
Code as per help of python tutor mailing list
Created: 26-Oct-2009
'''
intro = raw_input('press enter to view your internet data consumption: ')
log_file = '/home/bboymen/mobily.data.plan'
to
On Mon, Oct 26, 2009 at 2:12 PM, Luke Paireepinart
wrote:
>
>
> On Mon, Oct 26, 2009 at 3:20 AM, Christian Witts
> wrote:
>
>> fInput = open('/path/to/log.file', 'rb')
>> total_usage = 0
>> for line in fInput:
>> total_usage += int(line.split(' ')[9].strip())
>> print total_usage
>>
>
> It's ac
Hi all!
I have a file with data structure derived from wvdial log:
Oct 14 11:03:45 cc02695 pppd[3092]: Sent 3489538 bytes, received
43317854 bytes.
I want to get the 10th field of each line and get the sum for all lines
(total my net data usage). In awk u can easily pop it using field variabl
16 matches
Mail list logo