javuchi wrote:
> I want to avoid converting the dictionary to a list and then to a
> dictionay. Are there speed penalties for such a conversion?
You mean, is it faster to write, test, debug and
execute slow Python code rather than letting Python's
built-in routines written in fast C do the job?
Christoph Zwerschke wrote:
> This is probably a FAQ, but I dare to ask it nevertheless since I
> haven't found a satisfying answer yet: Why isn't there an "ordered
> dictionary" class at least in the standard list? Time and again I am
> missing that feature. Maybe there is something wrong with m
[EMAIL PROTECTED] wrote:
> Is there somthing wrong
Kids today, don't they learn about inheritence? :-)
Python's object model is that instances inherit both
methods and attributes from the class (and
superclasses). Methods are just a special case of
attributes: the method is a callable att
Hi,
I need to compress files in self-extract archive. I use the zipfile module.
Is there an option or parameter to do that?
Thanks in advance,
Catalin
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> [EMAIL PROTECTED] wrote:
>
> > Is there somthing wrong
>
> Kids today, don't they learn about inheritence? :-)
>
> Python's object model is that instances inherit both
> methods and attributes from the class (and
> superclasses). Methods are just a special case of
> at
Ashok wrote:
> hi,
> i am trying to develop a small gui app using boa constructor. say this
> app has one frame which has one static text control. i want the frame
> to resize itself to the width of the text contrl when i change the
> label of the text control via SetLabel(). how can i do this in b
Godwin Burby wrote:
> I was just curious about using the cmd module for building my
> own command line interface. i saw a problem. The script is as follows:
it helps if you include the code you were running, instead of some
approximation of it.
File "test", line 10
if passwd = 'god
Christoph Zwerschke wrote:
> >>I still believe that the concept of an "ordered dictionary" ("behave
> >>like dict, only keep the order of the keys") is intuitive and doesn't
> >>give you so much scope for ambiguity. But probably I need to work on an
> >>implementation to become more clear about po
Bengt Richter wrote:
> On 22 Nov 2005 02:16:22 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote:
>
> >
> >Kay Schluehr wrote:
> >> Christoph Zwerschke wrote:
> >>
> >> > That would be also biased (in favour of Python) by the fact that
> >> > probably very little people would look for and use the packag
BartlebyScrivener wrote:
> Hello, I'm new to python and trying to get records from an MSAccess
> database using mxODBC. It works, but the output is not formatted the
> way I want it.
>
> Here's the script:
>
> import mx.ODBC.Windows as odbc
>
> driv='DRIVER={Microsoft Access Driver (*.mdb)};DBQ=
Sorry! I just retyped my script instead of copy pasting it.
well thank u once again for clearing my confusion.
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Perhaps now the answer top your question is more obvious: there is by no
> means universal agreement on what an "ordered dictionary" should do.
> Given the ease with which Python allows you to implement your chosen
> functionality it would be presumptuous of the core develope
Christoph Zwerschke wrote:
> One implementation detail that I think needs further consideration is in
> which way to expose the keys and to mix in list methods for ordered
> dictionaries.
>
> In http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747
> the keys are exposed via the keys() me
There is already an update method of course. :-)
Slicing an ordered dictionary is interesting - but how many people are
actually going to use it ? (What's your use case)
You can already slice the sequence atribute and iterate over that.
All the best,
Fuzzyman
http://www.voidspace.org.uk/python
While we're on the subject, it would be useful to be able to paste in a
changelog as well as a description.
Currently when updating versions you have to include the changelog in
the description - or not at all...
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
--
http://m
Bengt Richter wrote:
> >Though it looks nice, it's an implementation dependant solution. What if
> >someone changes zip to fetch the second item first?
>
> That would be a counter-intuitive thing to do. Most things go left->right
> in order as the default assumption.
it's not only the order that
[EMAIL PROTECTED] wrote:
> Personally, I would like to see it as [('a',1,'b',2), ('c',3,
> None,None)], as a list of tuple of equal length is easier to be dealt
> with.
>
> i = iter(aList)
> zip(i,chain(i,repeat(None)),
> chain(i,repeat(None)),chain(i,repeat(None)))
Here's some more:
>>> it =
[EMAIL PROTECTED] wrote:
> led to more serious flaws like the missing if-then-else expression,
> something I use in virtually every piece of code I write, and which
> increases readability.
you obviously need to learn more Python idioms. Python works better
if you use it to write Python code; n
Bengt Richter wrote:
> On Tue, 22 Nov 2005 13:26:45 +0100, "Fredrik Lundh"
> <[EMAIL PROTECTED]> wrote:
>>Duncan Booth wrote:
>>
>>> >>> it = iter(aList)
>>> >>> zip(it, it)
>>> [('a', 1), ('b', 2), ('c', 3)]
>>
>>is "relying on undefined behaviour" perhaps the new black ?
> Is it really undefin
Neil Hodgson wrote:
>> Since no-one mentioned it and its a favourite of mine, you can use the
>> decorate-sort-undecorate method, or "Schwartzian Transform"
>
> That is what the aforementioned key argument to sort is: a built-in
> decorate-sort-undecorate.
And crucially it is a built-in DSU
I tried to use this method in my code like this:-
-
#!/usr/bin/python
def print_sql():
[EMAIL PROTECTED] wrote:
> [test 1]
>
class A:
>
> ...i = 1
> ...
>
a = A()
A.i
>
> 1
>
a.i
>
> 1
>
A.i = 2
A.i
>
> 2
>
a.i
>
> 2
>
>
> [test2]
>
class A:
>
> ...i = 1
> ...
>
a = A()
A.i
>
> 1
>
a.i
>
> 1
>
a.i = 2
A.i
The Eternal Squire wrote:
> I tend to use this design pattern a lot in order to aid in
> compartmentalizing interchangeable features in a central class that
> depend on the central class's data.
I'm afraid I've read this paragraph and the code 3 times and I still
have no idea what you're trying to
Once again a maybe silly question, but I find no solution, neither in
the documentation nor in examples.
I have got some different layouts to change place by the help of a
QGridLayout in its parent widget. To make it nice I use row/col spacing
and stretch respectively as well as multicell widge
Mohammad Jeffry wrote:
> I tried to use this method in my code like this:-
> -
> #!/usr/bin/python
>
>
> def print_sql():
> sql = '''aaa
> bbb'''.replace("\n","")
>
Mohammad Jeffry wrote:
> I can always do this :-
> -
> #!/usr/bin/python
>
>
> def print_sql():
> sql = '''aaa
> bbb'''.replace("\n","")
> print sql
>
> print_sql()
>
> -
You could use my includer script.
http://www.voidspace.org.uk/python/recipebook.shtml#includer
It effectively adds an include direct to python scripts.
##include module.py
from module import *
You then run ``includer.py infilename outfilename``
This replaces the ``##include ..`` with the sourc
[EMAIL PROTECTED] wrote:
> Duncan Booth wrote:
>> e.g. it is stable when you reverse the order:
>>
>> >>> lst = [[4,1],[4,2],[9,3],[5,4],[2,5]]
>> >>> list(reversed([ x[-1] for x in sorted([ (x[0],x) for x in lst ]) ]))
>> [[9, 3], [5, 4], [4, 2], [4, 1], [2, 5]]
>> >>> l1 = list(lst)
>> >>> l1.so
Peter Otten wrote:
> [EMAIL PROTECTED] wrote:
>
> > Duncan Booth wrote:
> >> e.g. it is stable when you reverse the order:
> >>
> >> >>> lst = [[4,1],[4,2],[9,3],[5,4],[2,5]]
> >> >>> list(reversed([ x[-1] for x in sorted([ (x[0],x) for x in lst ]) ]))
> >> [[9, 3], [5, 4], [4, 2], [4, 1], [2, 5]]
Op 2005-11-23, Fredrik Lundh schreef <[EMAIL PROTECTED]>:
> [EMAIL PROTECTED] wrote:
>
>> led to more serious flaws like the missing if-then-else expression,
>> something I use in virtually every piece of code I write, and which
>> increases readability.
>
> you obviously need to learn more Python
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
> > Perhaps now the answer top your question is more obvious: there is by no
> > means universal agreement on what an "ordered dictionary" should do.
> > Given the ease with which Python allows you to implement your chosen
> > functionality it would b
Regards.
On my system:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32, Windows XP
I have this problem:
>>> n = 61409 + 1
>>> data = 'x' * n
>>> print data
Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enou
Joseph Garvin wrote:
> >Jeff Epler's proposal to use unicode operators would synergise most
> >excellently with this, allowing python to finally reach, and even surpass,
> >the level of expressiveness found in languages such as perl, APL and
> >INTERCAL.
> >
> What do you mean by unicode operators
Christoph Zwerschke wrote:
> Ok, I just did a little research an compared support for ordered dicts
> in some other languages:
>
Just to add to your list:
In Javascript Object properties (often used as an associative array) are
defined as unordered although as IE seems to always store them in
thakadu wrote:
> However the line:
> del db[key]
> results in an error: (1, 'Operation not permitted')
> (only tested on Python 2.3.5)
Did you open the dbm file for read-write? This should work,
and is implemented.
> Could this be because the .del() method of the dictionary
> has not been impleme
On Tue, 22 Nov 2005 14:03:32 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
>"Shi Mu" wrote:
>
>>I use Python 2.3 to run the following code:
> a=[[1,2],[4,8],[0,3]]
> a.sort()
> a
>> [[0, 3], [1, 2], [4, 8]]
>
>> I wonder whether the sort function automatically consider the firs
Duncan Booth wrote:
> e.g. it is stable when you reverse the order:
>
> >>> lst = [[4,1],[4,2],[9,3],[5,4],[2,5]]
> >>> list(reversed([ x[-1] for x in sorted([ (x[0],x) for x in lst ]) ]))
> [[9, 3], [5, 4], [4, 2], [4, 1], [2, 5]]
> >>> l1 = list(lst)
> >>> l1.sort(key=operator.itemgetter(0), rev
On 22 Nov 2005 19:52:40 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>Bengt Richter wrote:
>> >>> def my_search(another, keys, x): return dict((k,another[k]) for k in
>> keys if another[k]>x)
>> ...
>> >>> my_search(another, 'cb', .3)
>> {'b': 0.35806602909756235}
>> >>> my_search
Hallo,
when trying to run the script ez_setup.py, I fail
with
unable to open /usr/lib/python2.3/config/Makefile
This is true. There is no /usr/lib/python2.3/config
directory. A check on groups.google revealed that
this is a bug in my debian distro or something. Is
this true? Is there a wor
Hi.
> when trying to run the script ez_setup.py, I fail
> with
>
> unable to open /usr/lib/python2.3/config/Makefile
>
> This is true. There is no /usr/lib/python2.3/config
> directory. A check on groups.google revealed that
> this is a bug in my debian distro or something. Is
> this true?
Tin Gherdanarra wrote:
> when trying to run the script ez_setup.py, I fail
> with
>
> unable to open /usr/lib/python2.3/config/Makefile
>
> This is true. There is no /usr/lib/python2.3/config
> directory. A check on groups.google revealed that
> this is a bug in my debian distro or something.
On 23 Nov 2005 01:24:46 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> wrote:
>
>[EMAIL PROTECTED] wrote:
>> Steve Holden wrote:
>> > Perhaps now the answer top your question is more obvious: there is by no
>> > means universal agreement on what an "ordered dictionary" should do.
>> > Given the ease wi
Fredrik Lundh wrote:
> > (Well, ok that is not the end of the world either but it's lack is
> > irritating
> > as hell, and yes, I know that it is now back in favor.)
>
> the thing that's in favour is "then-if-else", not "if-then-else".
>
there it comes :-)
--
http://mail.python.org/mailman/li
On Wed, 23 Nov 2005 09:54:46 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>
>> >Though it looks nice, it's an implementation dependant solution. What if
>> >someone changes zip to fetch the second item first?
>>
>> That would be a counter-intuitive thing to do. Most thin
On 23/11/05, Joseph Garvin <[EMAIL PROTECTED]> wrote:
> What do you mean by unicode operators? Link?
http://fishbowl.pastiche.org/2003/03/19/jsr666_extended_operator_set
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/py
Magnus Lycka wrote:
> Fredrik Lundh wrote:
>> cursor.execute(
>> 'select * from foo'
>> ' where bar=%s'
>> ' limit 100',
>> bar
>> )
>
> The disavantage with this is that it's easy to make
> a mistake, like this...
>
> cursor.execute(
> 'select
Bengt Richter wrote:
> Are you thinking of something like lines from a file, where there might be
> chunky buffering? ISTM that wouldn't matter if the same next method was
> called.
> Here we have multiple references to the same iterator. Isn't e.g. buiding
> a plain tuple defined with evaluation
Fredrik Lundh wrote:
> cursor.execute(
> 'select * from foo'
> ' where bar=%s'
> ' limit 100',
> bar
> )
The disavantage with this is that it's easy to make
a mistake, like this...
cursor.execute(
'select * from foo '
'where bar=%s
Simon Brunning wrote:
>> What do you mean by unicode operators? Link?
>
> http://fishbowl.pastiche.org/2003/03/19/jsr666_extended_operator_set
see also:
http://www.brunningonline.net/simon/blog/archives/000666.html
http://www.python.org/peps/pep-0666.html
--
http://mail.python.org/
On 22/11/05, Bengt Richter <[EMAIL PROTECTED]> wrote:
> That would be a counter-intuitive thing to do. Most things go left->right
> in order as the default assumption.
+1
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/p
Zoli wrote:
> Hi.
>
>
>>when trying to run the script ez_setup.py, I fail
>>with
>>
>> unable to open /usr/lib/python2.3/config/Makefile
>>
>>This is true. There is no /usr/lib/python2.3/config
>>directory. A check on groups.google revealed that
>>this is a bug in my debian distro or somethi
Bengt Richter wrote:
> >it's not only the order that matters, but also the number of items
> >read from the source iterators on each iteration.
> >
> Not sure I understand.
>
> Are you thinking of something like lines from a file, where there might be
> chunky buffering? ISTM that wouldn't matter
On 23/11/05, Catalin Lungu <[EMAIL PROTECTED]> wrote:
> Hi,
> I need to compress files in self-extract archive. I use the zipfile module.
> Is there an option or parameter to do that?
No, AFAIK. If you have a command line tool, perhaps you could try driving that.
--
Cheers,
Simon B,
[EMAIL PROTEC
Fredrik Lundh wrote:
> Bengt Richter wrote:
>
>> Are you thinking of something like lines from a file, where there might
>> be chunky buffering? ISTM that wouldn't matter if the same next method
>> was called. Here we have multiple references to the same iterator. Isn't
>> e.g. buiding a plain tu
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>OKB (not okblacke) wrote:
>> Fredrik Lundh wrote:
>> > [EMAIL PROTECTED] wrote:
[ ... ]
>> >> > so what would an entry-level Python programmer expect from this
>> >> > piece of code?
>> >> >
>> >> > for item in a.reverse():
>> >> > print ite
"Fuzzyman" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
>
> Christoph Zwerschke wrote:
>> - the internal keys list should be hidden
>
> I disagree. It is exposed so that you can manually change the
> order (e.g. to create a "sorted" dict, rather than one ordered
> by key insertion).
>
On 23/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> see also:
>
> http://www.brunningonline.net/simon/blog/archives/000666.html
> http://www.python.org/peps/pep-0666.html
PEP 666 should have been left open. There are a number of ideas that
come up here that should be added to it - and
Ganesan Rajagopal wrote:
>> [EMAIL PROTECTED] com <[EMAIL PROTECTED]> writes: > what would be
>
> the definition of "sorted" and "ordered", before we can > go on ? Sorted
> would be ordered by key comparison. Iterating over such a container will
> give you the keys in sorted order. Java ca
Sion Arrowsmith wrote:
> 1. sort() in place makes sense in terms of space, and is not
>completely unintuitive.
> 2. reverse() should do what sort() does.
> 3. The inexperienced user is most likely to expect the above
>code to print 3 2 1 3 2 1, and is more likely to have
>difficulty tr
Manlio Perillo wrote:
> Regards.
>
> On my system:
> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
> on win32, Windows XP
>
> I have this problem:
>
>
n = 61409 + 1
data = 'x' * n
>
>
print data
>
>
> Traceback (most recent call last):
> File "xxx", lin
Tin Gherdanarra wrote:
> [EMAIL PROTECTED] wrote:
> > Have you tried apt-get build-dep pypgsql ?
> >
> > It could be that you lacks the necessary packages to build it.
>
> funny you'd mention it, I did. pypgsql does not seem to
> be an apt-get package, however. It did not work because
> "E: Couldn
Martin you are great!
If I had just opened the file with f=bsddb185.hashopen('filename',''w')
it would have worked the first time.
So now I will create wrapper classes around the file classes of
bsddb185 and create the methods that I need to keep it consistent
with bsddb. Another small difference
I want to learn more about enterprise-level programming using Python
and PostgreSQL. From what I've searched, it seems that psycho is
interesting to improve runtime too. Do you have tutorials, articles and
tips to learn this combination? I've been working with PostgreSQL for 2
years, and with Pytho
[EMAIL PROTECTED] wrote:
> Have you tried apt-get build-dep pypgsql ?
>
> It could be that you lacks the necessary packages to build it.
funny you'd mention it, I did. pypgsql does not seem to
be an apt-get package, however. It did not work because
"E: Couldn't find package pypgsql"
The fact tha
Hallo,
I'm trying to install pypgsql. However, I get syntax errors
while compiling the C sources. The following excerpt
from pgconnection.h looks a little funny to me:
typedef struct {
PyObject_HEAD /* Here is the syntax error, and rightly so */
PGconn *conn;
PyObject *host;
P
On Tue, 2005-11-22 at 20:44, Tom Anderson wrote:
> On Tue, 22 Nov 2005, Carsten Haese wrote:
>
> > On Tue, 2005-11-22 at 14:37, Christoph Zwerschke wrote:
> >
> >> In Foord/Larosa's odict, the keys are exposed as a public member which
> >> also seems to be a bad idea ("If you alter the sequence l
MichaelW wrote:
> I've been Python (2.3.4) plus Tkinter happily under MacOX 10.3, having
> compiled them from scatch. (Tkinter is based on tcl/tk 8.4.1, which
> were compiled from source via Fink).
>
> I then moved my laptop over the 10.4, and things are now breaking.
> Using the Python shipped wi
That code works here.
Python2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
It's Windows XP, Pentium 4, unknown amount of RAM. I'm running python.exe in a
console window. It also worked in IDLE.
Jeff
pgptwrbVpG8CR.pgp
Description: PGP signature
--
http://mail.python.or
Tin Gherdanarra wrote:
> Hallo,
>
> I'm trying to install pypgsql. However, I get syntax errors
> while compiling the C sources. The following excerpt
> from pgconnection.h looks a little funny to me:
>
> typedef struct {
> PyObject_HEAD /* Here is the syntax error, and rightly so */
> [...]
On Wed, 2005-11-23 at 08:01, Tin Gherdanarra wrote:
> Hallo,
>
> I'm trying to install pypgsql. However, I get syntax errors
> while compiling the C sources. The following excerpt
> from pgconnection.h looks a little funny to me:
>
> typedef struct {
> PyObject_HEAD /* Here is the syntax err
Manlio Perillo wrote:
> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
> on win32, Windows XP
>
> I have this problem:
>
n = 61409 + 1
data = 'x' * n
>
print data
>
> Traceback (most recent call last):
> File "xxx", line xxx, in ?
>print data
> IOError: [
"Alan Kemp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> Can someone suggest a better (ie, valid) strategy for this?
Pass the connection to the thread as a parameter and use it to create a
cursor local to the thread. You may have to create a connection per thread
also - in
Have you tried apt-get build-dep pypgsql ?
It could be that you lacks the necessary packages to build it.
Tin Gherdanarra wrote:
> Hallo,
>
> I'm trying to install pypgsql. However, I get syntax errors
> while compiling the C sources. The following excerpt
> from pgconnection.h looks a little fun
Joseph Garvin wrote:
> Tom Anderson wrote:
>
>> Jeff Epler's proposal to use unicode operators would synergise most
>> excellently with this, allowing python to finally reach, and even
>> surpass, the level of expressiveness found in languages such as perl,
>> APL and INTERCAL.
s/expressiveness/u
Tin Gherdanarra wrote:
> typedef struct {
> PyObject_HEAD /* Here is the syntax error, and rightly so */
[snip]
> } PgConnection;
>
>
> I don't know what PyObject_HEAD or PGconn is,
> but if they are types, a syntax error is justified here:
>
> PyObject_HEAD /* Here is the syntax error *
And just to confirm, it does in fact work. If you move the
RegisterHotKey line to within the thread's run method, the thread's
message loop picks up the hotkey press.
--
http://mail.python.org/mailman/listinfo/python-list
"John Perks and Sarah Mount" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
> we have some Python code we're planning to GPL. However, bits of it were
> (This assumes the wxPython Licence is compatible with the GPL -- if not,
> do we just cosmetically change any remaining lines, so n
One obvious point is that, according to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/cerefWM_HOTKEY.asp
the WM_HOTKEY message is posted to the queue *of the thread which
registered the hotkey*. I haven't yet tried it myself to see, but in
your example the main th
Ben Sizer wrote:
> The Eternal Squire wrote:
>
>>I tend to use this design pattern a lot in order to aid in
>>compartmentalizing interchangeable features in a central class that
>>depend on the central class's data.
>
>
> I'm afraid I've read this paragraph and the code 3 times and I still
> hav
[EMAIL PROTECTED] wrote:
> a reminder" that the change is inplace. How arrogant! While
> I'm sure the designers had kindly intentions. my memory, though
> bad, is not that bad, and I object to being forced to write code
> that is more clunky than need be, because the designers thought
> they need
[EMAIL PROTECTED] wrote:
> Alex Martelli wrote:
>
>>[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> ...
>>
>>>intuitive seems to be a very subjective matter, depends on once
>>>background etc :-)
>>
>>That's a strong point of Ruby, actually -- allowing an exclamation mark
>>at the end of a metho
Andrea Gavana wrote:
> IIRC, wxPython license has nothing to do with GPL. Its license is far more
> "free" than GPL is.
That would be "free as in freeloading", right? (And no, I'm not
intending to start a licensing flame war with that remark, but I think
it's inappropriate to ignore central licens
Steve:
> I want to learn more about enterprise-level programming using Python
> and PostgreSQL. From what I've searched, it seems that psycho is
> interesting to improve runtime too. Do you have tutorials, articles and
> tips to learn this combination? I've been working with PostgreSQL for 2
> year
On Tue, 22 Nov 2005 23:17:31 -0700 in comp.lang.python, Steven Bethard
<[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] wrote:
[...]
>> IIRC, this was discussednd rejected in an SF bug report. It should not
>> be a defined behavior for severals reasons:
>[snip arguments about how confusing zip(it, i
[EMAIL PROTECTED] wrote:
> Tin Gherdanarra wrote:
>
>>[EMAIL PROTECTED] wrote:
>>
>>>Have you tried apt-get build-dep pypgsql ?
>>>
>>>It could be that you lacks the necessary packages to build it.
>>
>>funny you'd mention it, I did. pypgsql does not seem to
>>be an apt-get package, however. It di
> WHY WHY WHY the obsession with one-liners? What is wrong with the good old
> fashioned way?
> if cond:
>x = true_value
> else:
>x = false_value
Let me tell you something: I'm not a one-liner coder, but sometimes It
is necesary.
For example:
I need to translate data from a DataField to
Michele Simionato wrote:
> Steve:
> > I want to learn more about enterprise-level programming using Python
> > and PostgreSQL. From what I've searched, it seems that psycho is
> > interesting to improve runtime too. Do you have tutorials, articles and
> > tips to learn this combination? I've been w
This could be done easier this way:
L = [('odd','even')[n%2] for i in range(8)]
--
http://mail.python.org/mailman/listinfo/python-list
This could be done easier this way:
L = [('even','odd')[n%2] for n in range(8)]
--
http://mail.python.org/mailman/listinfo/python-list
David Isaac wrote:
> > Michael Spencer wrote:
> > > This can be written more concisely as a generator:
>
>
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > If iterable has no elements, I believe the behaviour should be [init],
> > there is also the case of init=None that needs t
Paul Boddie <[EMAIL PROTECTED]> wrote:
> That would be "free as in freeloading", right? (And no, I'm not
> intending to start a licensing flame war with that remark, but I think
> it's inappropriate to ignore central licensing concepts such as
> end-user freedoms, and then to make sweeping statemen
On Tue, 22 Nov 2005 18:49:15 +0100
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
> not directly. the only reliable way is to run it in a
> separate process, and use the resource module to set
> necessary limits.
Wow. Thank you Mr. Lundh, I never noticed that module. I
think I have an application for
Ben Bush wrote:
> I had the following code and when I clicked the left mouse button one
> time. I got green line and the second click got a purple line and the
> green disappeared.
> I was confused by two questions:
It's good that these postings are archived, so that teachers can
check them before
Gerhard Häring wrote:
> Tin Gherdanarra wrote:
>
>> Hallo,
>>
>> I'm trying to install pypgsql. However, I get syntax errors
>> while compiling the C sources. The following excerpt
>> from pgconnection.h looks a little funny to me:
>>
>> typedef struct {
>> PyObject_HEAD /* Here is the syntax
The Apache Software Foundation and The Apache HTTP Server Project are
pleased to announce the 3.2.5 Beta release mod_python.
Version 3.2.5b of mod_python features several new functions and attributes
providing better access to apache internals, file-based sessions and other
session improvement
Luis M. Gonzalez wrote:
> This could be done easier this way:
>
> L = [('even','odd')[n%2] for n in range(8)]
That is even/odd, his(created to demonstrate the uglies of ternary) has
4 states, zero, -/+ then even/odd.
--
http://mail.python.org/mailman/listinfo/python-list
Carsten Haese wrote:
> On Wed, 2005-11-23 at 08:01, Tin Gherdanarra wrote:
>
>>Hallo,
>>
>>I'm trying to install pypgsql. However, I get syntax errors
>>while compiling the C sources. The following excerpt
>>from pgconnection.h looks a little funny to me:
>>
>>typedef struct {
>> PyObject_HEAD
Magnus Lycka <[EMAIL PROTECTED]> wrote:
...
> >>indicate that the method is a mutator. So, you can have a.reverse [NOT
> >>mutating a since no !] _and_ a.reverse! [mutating a]. Probably too much
> >>of a change even for Python 3000, alas... but, it DOES make it obvious
> >>when an object's get
bruno at modulix wrote:
> Ben Sizer wrote:
> > I'm afraid I've read this paragraph and the code 3 times and I still
> > have no idea what you're trying to convey.
>
>
Got anything more constructive to add?
--
Ben Sizer
--
http://mail.python.org/mailman/listinfo/python-list
> Michael Spencer wrote:
> > This can be written more concisely as a generator:
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If iterable has no elements, I believe the behaviour should be [init],
> there is also the case of init=None that needs to be handled.
Right. So it is "
1 - 100 of 311 matches
Mail list logo