Rance Hall wrote:
Generally you have something like this:
clientlist = get_clients() # where get_clients is a prepared sql statement.
normally you would get the individual rows like this:
for row in clientlist:
do stuff
which is great for a long list of results. But I'm running into
is
Im using the py-postgresql module (docs here:
http://python.projects.postgresql.org/docs/1.0/)
in a python 3.1 environment to connect to my database.
so far everything is working, but I'm having trouble understanding the
structure of the variable returned by a select statement
Generally you have
On Tue, 02 Dec 2008 01:17:41 +, Alan Gauld wrote:
> while loops are used much less in Python than in other languages because
> for loops are so powerful.
Actually, I think python's for-loop is so powerful that while loop could
be removed from the language and no power would be lost (although
On Mon, Dec 1, 2008 at 7:56 PM, John Fouhy <[EMAIL PROTECTED]> wrote:
> [1] Technically, it iterates over an iterator, which you can think of
> as an object that behaves like a list when you throw it at a for loop.
The object of the 'in' must be an iterable, which is an object that
can produce an
"WM." <[EMAIL PROTECTED]> wrote
I recently asked a question about 'for' loops, expecting them to be
similar to 'for-next' loops. I have looked at several on-line tutors
but am still in the dark about what 'for' loops do.
Python for loops are like foreach loops in other languages.
A Python fo
On 02/12/2008, WM. <[EMAIL PROTECTED]> wrote:
> I recently asked a question about 'for' loops, expecting them to be similar
> to 'for-next' loops. I have looked at several on-line tutors but am still
> in the dark about what 'for' loops do.
> Does anyone have a plain English about the use of 'for
On Mon, Dec 1, 2008 at 6:44 PM, WM. <[EMAIL PROTECTED]> wrote:
> I recently asked a question about 'for' loops, expecting them to be similar
> to 'for-next' loops. I have looked at several on-line tutors but am still
> in the dark about what 'for' loops do.
> Does anyone have a plain English abou
On Mon, Dec 01, 2008 at 04:44:02PM -0800, WM. wrote:
> I recently asked a question about 'for' loops, expecting them to be
> similar to 'for-next' loops. I have looked at several on-line tutors but
> am still in the dark about what 'for' loops do.
> Does anyone have a plain English about the use
I recently asked a question about 'for' loops, expecting them to be
similar to 'for-next' loops. I have looked at several on-line tutors but
am still in the dark about what 'for' loops do.
Does anyone have a plain English about the use of 'for' loops?
Are 'while' loops the only way Python runs
PLEASE REPLY TO THE GROUP NOT JUST ME. Did you miss my request for that
(reply-all)?
Umesh Singhal wrote:
Hi Bob,
unfortunately when i pasted in the code it seems to have gone wrong
this is how it is at the moment with the correct indentation for the
nested loop:
code:
a=raw_input('please
On Sat, 2008-08-16 at 18:07 +0200, [EMAIL PROTECTED] wrote:
> Message: 1
> Date: Sat, 16 Aug 2008 06:33:42 +0100
> From: Umesh Singhal <[EMAIL PROTECTED]>
> Subject: [Tutor] For Loops and nested loops
> To:
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type:
On Sat, Aug 16, 2008 at 06:33:42AM +0100, Umesh Singhal wrote:
> Hi im still relatively new to python and i am designing a multiplication
> table that enables a user to input the size of the times table unfortunately
> ive stumbled on the nested loops this is what i have right now:
Is this a hom
Umesh Singhal wrote:
Hi im still relatively new to python and i am designing a
multiplication table that enables a user to input the size of the
times table unfortunately ive stumbled on the nested loops this is
what i have right now:
a=raw_input('please enter a number')
b=int(a)
n=b+1
for ro
Hi im still relatively new to python and i am designing a multiplication table
that enables a user to input the size of the times table unfortunately ive
stumbled on the nested loops this is what i have right now:
a=raw_input('please enter a number')
b=int(a)
n=b+1
for row in range(1, n):
+++ Emily Fortuna [22-06-06 13:22 -0400]:
| I feel like there should be a better way to do this process:
| Can you please help?
| (This is trivial example code I created off the top of my head, but the
| same concept that I am trying to do elsewhere.)
|
| class Person(object):
| def __init_
Emily Fortuna wrote:
> I feel like there should be a better way to do this process:
> Can you please help?
> (This is trivial example code I created off the top of my head, but the
> same concept that I am trying to do elsewhere.)
>
> class Person(object):
> def __init__(self, first_name, a
I feel like there should be a better way to do this process:
Can you please help?
(This is trivial example code I created off the top of my head, but the
same concept that I am trying to do elsewhere.)
class Person(object):
def __init__(self, first_name, age, fav_color):
s
>> >>Write a Python program to print out the following shape.
>> >>You are expected to use two for loops (these must be nested) to solve
>> this problem.
>>
>> output:
>> * * * * *
>> * *
>> * *
>> * * * * *
>
> That looks a lot like homework.
I agree and very poo
* josip <[EMAIL PROTECTED]> [2006-04-11 09:13]:
> I have problem with this question.
> Can someone show me the code and than explain it?
>
> >>Write a Python program to print out the following shape. You are
> expected to use two for loops (these must be nested) to solve this problem.
>
I have problem with this question. Can someone show me the code and than explain it? >>Write a Python program to print out the following shape. You are expected to use two for loops (these must be nested) to solve this problem. output: * * * * * * * * * * * * * *
Matthew White wrote:
> Hello,
>
>>From a general style and/or programmatic perspective, which is a "better"
> way to write this bit of code?
Hmm, neither?
>
> try:
> (dn, attrs) = conn.search_s(search_base, search_scope, search_filter,
> search_attrs):
> except Exception, e:
> warn_
Hello,
>From a general style and/or programmatic perspective, which is a "better"
way to write this bit of code?
try:
(dn, attrs) = conn.search_s(search_base, search_scope, search_filter,
search_attrs):
except Exception, e:
warn_the_user(e)
do_something_useful()
for (name, d
22 matches
Mail list logo