Hi Python Tutor folks,
I am reaching out to various Python-related programming communities in
order to offer new help packaging your software.
If you have ever struggled with packaging and releasing Python software
(e.g. to PyPI), please check out this service:
- http://pythonpackages.com
T
Tino Dai wrote:
I just remember that there was a performance hit or something for doing
that.
Does that sound familiar to anyone?
Yes, and no.
Creating a try block in Python is lightweight and fast. It is about as fast as
the "pass" statement, that is, pretty damn fast and more or less faste
Tino Dai wrote:
Yes, but that would involve surrounding the entire method with a try except
finally block. I was
told by the Python-Guru-In Residence that shouldn't emulate Java code in
Python, and that was
generally bad programming practice (no flame war intended)
And that is correct. It is *
> Hello all! I have a very simple question but I'm very new to python. Could you
> describe to me what the following piece of Python code says in English
> please?
Welcome to the list and Python! When posting code in the future I recommend
posting in plain text and not "rich" text or HTML. If you
On 7/30/2012 12:52 PM Victoria Homsy said...
Hello all! I have a very simple question but I'm very new to python.
Could you describe to me what the following piece of Python code says in
English please?
def print_a_line(line_count, f):
print line_count, f.readline()
This function accepts
Damn! So its so serious they have a name for it! No wonder I was stumped
...
Any way thanks you guys have been super helpful.
بتاريخ الاثنين، ٣٠ يوليو، ٢٠١٢، جاء من Peter Otten
__pete...@web.de
:
> Khalid Al-Ghamdi wrote:
>
> > I am a teacher at an industrial training center. We have to conduct
On Mon, Jul 30, 2012 at 3:10 PM, Tino Dai wrote:
> On Mon, Jul 30, 2012 at 1:52 PM, Mark Lawrence
> wrote:
>
>> Sorry I'm not completely sure what you're asking for but will this help
>> http://docs.python.org/library/atexit.html ?
>>
> I think this might be what I'm looking for. But for about 2
Hello all! I have a very simple question but I'm very new to python. Could you
describe to me what the following piece of Python code says in English please?
def print_a_line(line_count, f):
print line_count, f.readline()
I understand that line_count counts the number of lines in the Python pro
On Mon, Jul 30, 2012 at 3:35 PM, Brett Ritter wrote:
> On Mon, Jul 30, 2012 at 12:20 PM, Tino Dai wrote:
> > Yes, but that would involve surrounding the entire method with a try
> except
> > finally block. I was
> > told by the Python-Guru-In Residence that shouldn't emulate Java code in
> > Pyt
On Mon, Jul 30, 2012 at 12:20 PM, Tino Dai wrote:
> Yes, but that would involve surrounding the entire method with a try except
> finally block. I was
> told by the Python-Guru-In Residence that shouldn't emulate Java code in
> Python, and that was
> generally bad programming practice (no flame wa
On 30-Jul-12 10:52, Mark Lawrence wrote:
On 30/07/2012 17:56, Tino Dai wrote:
Is there anyway to execute a block of code at the end of a
program in
2.6 regardless of what happened before eg exiting normally or died
because
of an exception?
Sorry I'm not completely sure what you're askin
On 30/07/12 17:56, Tino Dai wrote:
Is there anyway to execute a block of code at the end of a program
in 2.6 regardless of what happened before eg exiting normally or died
because of an exception?
Yes, try/finally.
That's what it's there for.
I was thinking about maybe a free standing
On Mon, Jul 30, 2012 at 1:44 PM, Prasad, Ramit wrote:
> > Actually, what I'm doing is keeping a pending item log in memory as an
> array
> > and then saving it to the DB at the end of the program, but what happens
> if
> > the user hits ctrl-c, then the pending items array is lost. That's the
> us
On Mon, Jul 30, 2012 at 2:44 PM, Albert-Jan Roskam wrote:
> *From:* Tino Dai
>
> *To:* nz*tutor pythonzzz
> *Sent:* Monday, July 30, 2012 6:56 PM
> *Subject:* [Tutor] finally without try or except
>
> Hi!
>
> Is there anyway to execute a block of code at the end of a program in
> 2.6 regar
On Mon, Jul 30, 2012 at 1:52 PM, Mark Lawrence wrote:
> On 30/07/2012 17:56, Tino Dai wrote:
>
>> Hi!
>>
>> Is there anyway to execute a block of code at the end of a program
>> in
>> 2.6 regardless of what happened before eg exiting normally or died because
>> of an exception?
>> I was thin
From: Tino Dai
To: nz*tutor pythonzzz
>Sent: Monday, July 30, 2012 6:56 PM
>Subject: [Tutor] finally without try or except
>
>
>Hi!
>
>
> Is there anyway to execute a block of code at the end of a program in 2.6
>regardless of what happened before eg exiting normally or died because of an
Khalid Al-Ghamdi wrote:
> I am a teacher at an industrial training center. We have to conduct
> hands-on exams (fixing pumps, etc). I review all the test schedules for
> all the students (made by other teachers) to make sure there are no
> clashes due to lack of ample supply of equipment or tools.
On 30/07/2012 17:56, Tino Dai wrote:
Hi!
Is there anyway to execute a block of code at the end of a program in
2.6 regardless of what happened before eg exiting normally or died because
of an exception?
I was thinking about maybe a free standing finally code block or a
decorator.
Any hint
> Actually, what I'm doing is keeping a pending item log in memory as an array
> and then saving it to the DB at the end of the program, but what happens if
> the user hits ctrl-c, then the pending items array is lost. That's the use
> case that I'm looking for a solution to.
http://docs.python.or
On Mon, Jul 30, 2012 at 1:16 PM, Marc Tompkins wrote:
> On Mon, Jul 30, 2012 at 9:56 AM, Tino Dai wrote:
>
>> Hi!
>>
>> Is there anyway to execute a block of code at the end of a program
>> in 2.6 regardless of what happened before eg exiting normally or died
>> because of an exception?
>> I
On Mon, Jul 30, 2012 at 9:56 AM, Tino Dai wrote:
> Hi!
>
> Is there anyway to execute a block of code at the end of a program in
> 2.6 regardless of what happened before eg exiting normally or died because
> of an exception?
> I was thinking about maybe a free standing finally code block or
Hi!
Is there anyway to execute a block of code at the end of a program in
2.6 regardless of what happened before eg exiting normally or died because
of an exception?
I was thinking about maybe a free standing finally code block or a
decorator.
Any hints?
Tino
Thanks for your input Walter. Are there any techniques to achieve this via
code or sql you share. Because I was thinking along the same you mentioned
but didnt knwo how to go about it.
بتاريخ الاثنين، ٣٠ يوليو، ٢٠١٢، جاء من Walter Prins wpr...@gmail.com:
> On 30 July 2012 14:57, Khalid Al-Ghamdi
On Mon, Jul 30, 2012 at 9:35 PM, Victoria Homsy wrote:
> Hi! I am a new Python user, and would really appreciate some help. My code
> is as follows:
>
> from sys import argvs
> script, mum_mood, dad_mood = argvs
>
> # my own function
> def dad_and_mum_mood(mum_mood, dad_mood):
> print "If both mum
Hi! I am a new Python user, and would really appreciate some help. My code is
as follows:
from sys import argvs
script, mum_mood, dad_mood = argvs
# my own function
def dad_and_mum_mood(mum_mood, dad_mood):
print "If both mum and dad are in a good mood, all is good."
print "If one is and one isn
On 30 July 2012 14:57, Khalid Al-Ghamdi wrote:
> Hi All,
>
> I am a teacher at an industrial training center. We have to conduct hands-on
> exams (fixing pumps, etc). I review all the test schedules for all the
> students (made by other teachers) to make sure there are no clashes due to
> lack of
Hi All,
I am a teacher at an industrial training center. We have to conduct
hands-on exams (fixing pumps, etc). I review all the test schedules for all
the students (made by other teachers) to make sure there are no clashes due
to lack of ample supply of equipment or tools. Meaning no two trainees
27 matches
Mail list logo