On Wed, Mar 18, 2009 at 11:45 PM, srinivasan srinivas
wrote:
>
> Hi,
> Could someone help me in understanding what 64-bit python means?
It's been compiled for 64-bit processors, so it uses 64-bit pointers
and 64-bit small integers. And I would think it would only work w/ C
extension libraries als
On Mar 19, 2:42 pm, Ralf Schoenian wrote:
> mark.coll...@csiro.au wrote:
> > Many times I am developing a code in a file and I want to, for
> > example, exit at a specific line so that I can test something. In tcl
> > you can just put an exit command in and source the file. Is there an
> > equival
Hi,
Could someone help me in understanding what 64-bit python means?
tahnks,
Srini
Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/
--
http://mail.python.org/mailman/listinfo/python-list
> When we say readability counts over complexity, how do we define what
> level of complexity is ok?
> For example:
> Say I have dict a = {'a': 2, 'c': 4, 'b': 3}
> I want to increment the values by 1 for all keys in the dictionary.
> So, should we do:
for key in a:
> ... a[key] = a[key] + 1
bieff...@gmail.com wrote:
> If you have worked with C/C++, you know that memory-related bugs can
> be very tricky.
> More than once - working with C code - I had crashes that disappeared
> if I just added
> a 'printf', because the memory allocation scheme changed and the
> memory corrupted was not
Hi ,
I am using following code to create a graph
def plot_plot():
ax = pylab.subplot(111)
for count in range(len(yaxes_values)):
pylab.subplots_adjust(left=0.13, bottom=0.21,
right=0.90, top=0.90,wspace=0.20, hspace=0.20)
ax.plot_date(id_dates,yaxes_values[count],fmt='o-
Thanks Nick.
The website content is impressive.
Thanks
Agni
-Original Message-
From: Nick Craig-Wood [mailto:n...@craig-wood.com]
Sent: Wednesday, March 18, 2009 9:00 PM
To: python-list@python.org
Subject: Re: Python to Perl transalators
Armin wrote:
> On Wednesday 18 March 2009 1
The below code does the trick with one small problem left to be solved
import shutil
import string
currentdata_file = r"C:\Users\Owner\Desktop\newdata.txt" # the current
download from the clock
lastdata_file = r"C:\Users\Owner\Desktop\mydata.txt" # the prior
download from the clock
output_file =
On Mar 19, 1:20 pm, "Gabriel Genellina"
wrote:
> En Thu, 19 Mar 2009 00:52:54 -0200, escribió:
>
> > I'm aware that C, and thus Python I suppose, will cache file writes
> > for efficiency and to avoid excessive disk activity,
>
> Python 2.X, yes, because it uses C file streams (FILE) to implement
bearophileh...@lycos.com wrote:
>
>In Python 3 those lines become shorter:
>
>for k, v in a.items():
>{k: v+1 for k, v in a.items()}
That's a syntax I have not seen in the 2-to-3 difference docs, so I'm not
familiar with it. How does that cause "a" to be updated?
--
Tim Roberts, t...@probo.com
P
On Mar 19, 4:42 am, Ralf Schoenian wrote:
> mark.coll...@csiro.au wrote:
> > Many times I am developing a code in a file and I want to, for
> > example, exit at a specific line so that I can test something. In tcl
> > you can just put an exit command in and source the file. Is there an
> > equival
mark.coll...@csiro.au wrote:
Many times I am developing a code in a file and I want to, for
example, exit at a specific line so that I can test something. In tcl
you can just put an exit command in and source the file. Is there an
equivalent for python? Thanks,
Hi Mark,
there is:
import sys
s
On Mar 18, 5:21 am, Tino Wildenhain wrote:
> gaeasian...@gmail.com wrote:
> > Hi !
>
> > I'm new to Python. I'm having some difficulties to redirect the pages
> > using python. Every time when I redirect, the URL changed accordingly.
>
> > (Example : from http://localhost: to
> > http://lo
Many times I am developing a code in a file and I want to, for
example, exit at a specific line so that I can test something. In tcl
you can just put an exit command in and source the file. Is there an
equivalent for python? Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 7, 8:47 pm, Raymond Hettinger wrote:
> The existing groupby() itertool works great when every element in a
> group has the same key, but it is not so handy when groups are
> determined by boundary conditions.
>
> For edge-triggered events, we need to convert a boundary-event
> predicate to
En Thu, 19 Mar 2009 00:52:54 -0200, escribió:
I'm aware that C, and thus Python I suppose, will cache file writes
for efficiency and to avoid excessive disk activity,
Python 2.X, yes, because it uses C file streams (FILE) to implement Python
file objects. Python 3.x avoids that layer.
Do
I'm aware that C, and thus Python I suppose, will cache file writes
for efficiency and to avoid excessive disk activity, causing
occasional problems when forgetting to flush. How exactly this works
is still somewhat of a mystery to me, but a concern because of a
program I'm developing:
The progra
In article <6ca71455-2fb2-4dd0-a500-2a480d815...@v6g2000vbb.googlegroups.com>,
Raymond Hettinger wrote:
>
>For edge-triggered events, we need to convert a boundary-event
>predicate to groupby-style key function. The code below encapsulates
>that process in a new itertool called split_on().
>
>Wo
En Wed, 18 Mar 2009 21:02:42 -0200, Emile van Sebille
escribió:
JohnV wrote:
> What I want to do is compare the old data (lets day it is saved to a
file called 'lastdata.txt') with the new data (lets day it is saved to
a file called 'currentdata.txt') and save the new appended data to a
va
En Wed, 18 Mar 2009 18:49:19 -0200, mattia escribió:
Il Wed, 18 Mar 2009 13:20:14 -0700, Aahz ha scritto:
In article <49c1562a$0$1115$4fafb...@reader1.news.tin.it>, mattia
wrote:
Yeah, and I believe that we can say the same for: 1 - t = [x*2 for x in
range(10)]
2 - t = list(x*2 for x in rang
On Mar 19, 8:50 am, Thomas Robitaille
wrote:
> I am trying to upload a binary file (a tar.gz file to be exact) to a
> web server using POST, from within a python script.
>
> What I would like is essentially the equivalent of
>
> enctype="multipart/form-data">
>
>
have you seen http://code.ac
On Mar 18, 4:50 pm, "andrew cooke" wrote:
> this is completely normal (i do exactly this all the time), BUT you should
> use "==", not "is".
Typically, but not always; for example check out the identity map [1]
pattern used in SQLAlchemy [2].
George
[1] http://martinfowler.com/eaaCatalog/ide
>> > I'm working on some graph generation problem where the node identity
>> > is significant (e.g. "if node1 is node2: # do something) but ideally I
>> > wouldn't want to impose any constraint on what a node is (i.e. require
>> > a base Node class). It's not a show stopper, but it would be
>> > pr
> What I was wondering
> was whether a similar construct was considered for a while loop or even an
> if clause, because then the above could be written like this:
>
> if open(filename, 'rb') as f:
> while f.read(1000) as buf:
> # do something with 'buf'
>
see here, and the associat
On Mar 18, 1:56 pm, a...@pythoncraft.com (Aahz) wrote:
> In article ,
> R. David Murray wrote:
>
>
>
> >That said, I've heard mention here of something that can apparently be
> >used for this. I think it was some incarnation of Webkit. I remember
> >someone saying you wanted to use the one with,
On Mar 18, 1:32 am, Armin wrote:
> On Wednesday 18 March 2009 11:01:00 Boris Borcic wrote:
>
> > Armin wrote:
> > >>
> > >> Why on earth would you want to? That'd be like translating Shakespeare
> > >> into a bad rap song!
> > >>
>
> > > lol, actually I would prefer a rap song over Shakespeare,
On Mar 18, 4:06 pm, Daniel Fetchinson
wrote:
> > I'm working on some graph generation problem where the node identity
> > is significant (e.g. "if node1 is node2: # do something) but ideally I
> > wouldn't want to impose any constraint on what a node is (i.e. require
> > a base Node class). It's
Hello,
I am trying to upload a binary file (a tar.gz file to be exact) to a
web server using POST, from within a python script.
At the moment I am trying
URL="http://www.whatever.com";
f=open(filename, 'rb')
filebody = f.read()
f.close()
data = {'name':'userfile','file': filebody}
u = urllib
On Mar 18, 8:47 am, Adam wrote:
> On Mar 17, 1:49 pm, Aaron Brady wrote:
>
>
>
> > You would need a unique attribute to look for on values in the
> > dictionary, which means you'd need to detect what functions you are
> > renaming; possibly by using a decorator to mark them. (Untested:)
>
> > cl
> You have to know the original encoding (I mean, the one used for the csv
> file), else there's nothing you can do. Then it's just a matter of
> decoding (to unicode) then encoding (to utf8), ie (if your source is in
> latin1):
>
> utf_string = latin1_string.decode("latin1").encode("utf8")
The O
On Mar 18, 3:05 pm, Grant Edwards wrote:
> {snip] ... If it
> only going to be used once, then just do the usual thing:
>
> f = open(...)
> while True:
> buf = f.read()
> if not buf: break
> # whatever.
> f.close()
+1
That's the canonical way (maybe using "with ... as" nowadays). Surel
Mike314 wrote: (paraphrased)
>>> test_func(val=('val1'))
>>> test_func(val=('val1', 'val2'))
The output is quite different. Why I have string in the first case?
More natural English: "Why do I get string in the first case?"
(X) is the same as X (parentheses are for grouping), to get
a singl
Mike314 wrote:
> Hello,
>
>I have following code:
>
> def test_func(val):
> print type(val)
>
> test_func(val=('val1'))
> test_func(val=('val1', 'val2'))
>
> The output is quite different:
>
>
>
>
> Why I have string in the first case?
Because in Python the syntactic element that
Mike314 wrote:
Hello,
I have following code:
def test_func(val):
print type(val)
test_func(val=('val1'))
test_func(val=('val1', 'val2'))
The output is quite different:
Why I have string in the first case?
Because () == .
Perhaps you meant ('val1',).
"Parenthesized forms
A parent
On Wed, 2009-03-18 at 16:58 -0700, Mike314 wrote:
> Hello,
>
>I have following code:
>
> def test_func(val):
> print type(val)
>
> test_func(val=('val1'))
> test_func(val=('val1', 'val2'))
>
> The output is quite different:
>
>
>
>
> Why I have string in the first case?
You could h
Mike314 wrote:
Hello,
I have following code:
def test_func(val):
print type(val)
test_func(val=('val1'))
test_func(val=('val1', 'val2'))
The output is quite different:
Why I have string in the first case?
It's the comma that makes the tuple, except for one special case: the
empty
Hello,
I have following code:
def test_func(val):
print type(val)
test_func(val=('val1'))
test_func(val=('val1', 'val2'))
The output is quite different:
Why I have string in the first case?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
In article <814f91a3-faa4-4473-b28f-8e0e217fb...@f33g2000vbf.googlegroups.com>,
odeits wrote:
>
>for row in rows:
>ad = dict()
Micro-optimization:
ad = {}
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
"Programming language design is not a rational sci
On Wed, 18 Mar 2009 17:30:45 -, Kottiyath
wrote:
When we say readability counts over complexity, how do we define what
level of complexity is ok?
We don't. There is no One True Way that defines for us what complexity
is, never mind how much of it is too much. It's a judgement call tha
Bruno Desthuilliers wrote:
Tim Chase a écrit :
(if your columns in your CSV happen to match the order of your INSERT
statement, you can just use
execute(sql, tuple(row))
Or more simply:
cursor.execute(sql, row)
that's always annoyed me with the mxODBC drivers I've
usedthey req
Lobo a écrit :
Hi,
My experience has been with Smalltalk using Object databases.
I would very much appreciate your recommendations on a Python IDE
closest to the Smalltalk 'image' environment, with class browsers,
implementors/senders, inspectors, debuggers, etc.
Well, Python is file-based, n
JohnV wrote:
> What I want to do is compare the old data (lets day it is saved to a
file called 'lastdata.txt') with the new data (lets day it is saved to
a file called 'currentdata.txt') and save the new appended data to a
variable
You may get away with something like: (untested)
newdata=op
rewonka a écrit :
(snip)
Now i stucked when i tried to pu into db.
Because i have some cell that is in somekind of unicoded text,
You mean "encoded in something else than utf8" ?
and i'm
looking a solution how to put this into db (my db in utf-8 format).
(snip)
but something binary in a c
Maybe something like this will work though I am not sure of my quotes
and what to import
import shutil
f = open(r'C:\Users\Owner\Desktop\mydata.txt', 'r')
read_data1 = f.read()
f.close()
shutil.copy('C:\Users\Owner\Desktop\newdata.txt', 'C:\Users\Owner
\Desktop\out.txt')
file = open(r'C:\Users\O
Tim Chase a écrit :
sql = ''' INSERT INTO table (column1,column2, ...) VALUES ( %s,
%s, ); '''
for row in rows:
connection.cursor.execute(sql % (row[0],row[1],))
connection.corsur.commit()
(snip)
The first step is to use the database's quoting to prevent problems
where miscreant
En Wed, 18 Mar 2009 15:13:32 -0300, Mike Driscoll
escribió:
On Mar 18, 1:09 am, "Gabriel Genellina"
wrote:
En Tue, 17 Mar 2009 00:16:53 -0200, MRAB
escribió:
> Ian Mallett wrote:
>> I'd like to make a program that automatically runs on startup
(right
>> after login). How should I
On Wed, Mar 18, 2009 at 2:30 PM, JohnV wrote:
> I have a txt file that gets appended with data over a time event. The
> data comes from an RFID reader and is dumped to the file by the RFID
> software. I want to poll that file several times over the time period
> of the event to capture the curre
> Andreas (A) wrote:
>A> Hello there,
>A> I have a problem moving files from my local harddrive to a NFS share using
>A> a Python script.
>A> The script is used to run a model which produces large (~500MB) binary
>A> output files. The model itself is a Fortran program, and I call it from my
>
I have a txt file that gets appended with data over a time event. The
data comes from an RFID reader and is dumped to the file by the RFID
software. I want to poll that file several times over the time period
of the event to capture the current data in the RFID reader.
When I read the data I wan
In article ,
R. David Murray wrote:
>
>That said, I've heard mention here of something that can apparently be
>used for this. I think it was some incarnation of Webkit. I remember
>someone saying you wanted to use the one with, I think it was GTK
>bindings, even though you were dealing with just
On Mar 18, 2:14 pm, Tim Wintle wrote:
> On Wed, 2009-03-18 at 11:13 -0700, Mike Driscoll wrote:
> > On Mar 18, 1:09 am, "Gabriel Genellina"
> > > Any decent installer is able to register a program so it runs on startup
> > > (InnoSetup, by example). Anyway, if you want to it it yourself,
> > >
George Sakkis wrote:
> I'm working on some graph generation problem where the node identity
> is significant (e.g. "if node1 is node2: # do something) but ideally I
> wouldn't want to impose any constraint on what a node is (i.e. require
> a base Node class). It's not a show stopper, but it would b
Il Wed, 18 Mar 2009 13:20:14 -0700, Aahz ha scritto:
> In article <49c1562a$0$1115$4fafb...@reader1.news.tin.it>, mattia
> wrote:
>>
>>Yeah, and I believe that we can say the same for: 1 - t = [x*2 for x in
>>range(10)]
>>2 - t = list(x*2 for x in range(10))
>>or not?
>
> The latter requires ge
I just installed the latest version of mock (0.4.0) under both Python 2.6
and 2.7 (svn trunk). In both cases pydoc fails to find anything:
~% pydoc2.6 mock
no Python documentation found for 'mock'
~% pydoc2.7 mock
no Python documentation found for 'mock'
but this works from the
Terry Reedy wrote:
> andrew cooke wrote:
> > [sorry for dup terry; prev not to list]
> >
> > Terry Reedy wrote:
> >> @alias('justAsFantastic')
> >> def someFantasticMethod(args): ...
> >
> > does this exist? i read the previous post and thought "i think a
> > decorator could do that", but i hav
On Wednesday 18 March 2009 15:14:30 markolopa wrote:
> Hello,
>
> When comparing python and java with a colleague who is fan of java,
> she challenged me to find in python the equivalent to the following
> technologies. Could you please help telling if we have something
> equivalent in python or no
Greg wrote:
> Hello all, I've been trying to find a way to fetch and read a web page
> that requires javascript on the client side and it seems impossible.
> I've read several threads in this group that say as much but I just
> can't believe it to be true (I'm subscribing to the "argument of
> per
In article <49c1562a$0$1115$4fafb...@reader1.news.tin.it>,
mattia wrote:
>
>Yeah, and I believe that we can say the same for:
>1 - t = [x*2 for x in range(10)]
>2 - t = list(x*2 for x in range(10))
>or not?
The latter requires generator expressions, which means it only works with
Python 2.4 or h
Il Wed, 18 Mar 2009 09:34:57 -0700, Aahz ha scritto:
> In article , Peter Otten
> <__pete...@web.de> wrote:
>>mattia wrote:
>>>
>>> cpop += [nchromosome1] + [nchromosome2]
>>
>>I'd write that as
>>
>>cpop.append(nchromosome1)
>>cpop.append(nchromosome2)
>>
>>thus avoiding the intermediate
>> > Is there a way to turn off (either globally or explicitly per
>> > instance) the automatic interning optimization that happens for small
>> > integers and strings (and perhaps other types) ? I tried several
>> > workarounds but nothing worked:
>>
>> No. It's an implementation detail.
>>
>> Wh
Hello all, I've been trying to find a way to fetch and read a web page
that requires javascript on the client side and it seems impossible.
I've read several threads in this group that say as much but I just
can't believe it to be true (I'm subscribing to the "argument of
personal incredulity " her
George Sakkis wrote:
On Mar 18, 2:13 pm, "R. David Murray" wrote:
George Sakkis wrote:
Is there a way to turn off (either globally or explicitly per
instance) the automatic interning optimization that happens for small
integers and strings (and perhaps other types) ? I tried several
workaroun
In article ,
andrew cooke wrote:
>Terry Reedy wrote:
>>
>> @alias('justAsFantastic')
>> def someFantasticMethod(args): ...
>
>does this exist? i read the previous post and thought "i think a
>decorator could do that", but i haven't written one.
>
>the reason i ask is that for 3->2 backwards compa
Hi,
My experience has been with Smalltalk using Object databases.
I would very much appreciate your recommendations on a Python IDE
closest to the Smalltalk 'image' environment, with class browsers,
implementors/senders, inspectors, debuggers, etc.
I am planning to use the following technologies
>>> Is there a way to turn off (either globally or explicitly per
>>> instance) the automatic interning optimization that happens for small
>>> integers and strings (and perhaps other types) ? I tried several
>>> workarounds but nothing worked:
>> No. It's an implementation detail.
>>
>> What use
sql = ''' INSERT INTO table (column1,column2, ...) VALUES ( %s,
%s, ); '''
for row in rows:
connection.cursor.execute(sql % (row[0],row[1],))
connection.corsur.commit()
but something binary in a cell, the pgdb says it is not in utf-8
format, or something like this.
I know it's a newbi
On márc. 18, 14:10, Peter Otten <__pete...@web.de> wrote:
> rewonka wrote:
> > I had a problem, i would like to process a file into a PSQL, but in
> > the file the delimiter char is ':'
> > and i have the same charater inside the text field also.
> > something like this:
> > text = 1:23:34:"sample:
On Wed, 2009-03-18 at 11:13 -0700, Mike Driscoll wrote:
> On Mar 18, 1:09 am, "Gabriel Genellina"
> > Any decent installer is able to register a program so it runs on startup
> > (InnoSetup, by example). Anyway, if you want to it it yourself,
> > see:http://msdn.microsoft.com/en-us/library/bb77
On Mar 18, 2:13 pm, "R. David Murray" wrote:
> George Sakkis wrote:
> > Is there a way to turn off (either globally or explicitly per
> > instance) the automatic interning optimization that happens for small
> > integers and strings (and perhaps other types) ? I tried several
> > workarounds but
On Mar 18, 1:14 pm, markolopa wrote:
> Hello,
>
> When comparing python and java with a colleague who is fan of java,
> she challenged me to find in python the equivalent to the following
> technologies. Could you please help telling if we have something
> equivalent in python or not and how they
On Mar 18, 1:09 pm, Paul Rudin wrote:
> Aniket M writes:
> > Note: Communication MUST be perfect!, Plus submit with 3 professional
> > references
>
> Irony :)
I have yet to meet anyone with perfect communication. I think this is
an "unfillable" position.
Mike
--
http://mail.python.org/mailman/l
Hello,
When comparing python and java with a colleague who is fan of java,
she challenged me to find in python the equivalent to the following
technologies. Could you please help telling if we have something
equivalent in python or not and how they compare to the java
solutions?
- persistance fra
On Mar 18, 1:09 am, "Gabriel Genellina"
wrote:
> En Tue, 17 Mar 2009 00:16:53 -0200, MRAB
> escribió:
>
> > Ian Mallett wrote:
> >> I'd like to make a program that automatically runs on startup (right
> >> after login). How should I do that?
>
> > Put it in the folder:
>
> > C:\Documents an
You realize of course that these two alternatives are not equivalent.
The first does what your problem statement describes, for each key in
a given dict, increments the corresponding value. The second creates
an entirely new dict with the modified values. Even if you were to
write the second one
Aniket M writes:
> Note: Communication MUST be perfect!, Plus submit with 3 professional
> references
Irony :)
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> Is there a way to turn off (either globally or explicitly per
> instance) the automatic interning optimization that happens for small
> integers and strings (and perhaps other types) ? I tried several
> workarounds but nothing worked:
No. It's an implementation detail.
Wh
Quoting Jim Garrison :
> Jim Garrison wrote:
> > Luis Zarrabeitia wrote:
> >> On Tuesday 17 March 2009 06:04:36 pm Jim Garrison wrote:
> >> with open(filename, "rb") as f:
> >> for buf in iter(lambda: f.read(1000),''):
> >> do_something(buf)
> >
> > This is the most pythonic solution
On Mar 18, 1:30 pm, Kottiyath wrote:
> When we say readability counts over complexity, how do we define what
> level of complexity is ok?
> For example:
> Say I have dict a = {'a': 2, 'c': 4, 'b': 3}
> I want to increment the values by 1 for all keys in the dictionary.
> So, should we do:>>> for
On Mar 18, 1:30 pm, Kottiyath wrote:
> When we say readability counts over complexity, how do we define what
> level of complexity is ok?
> For example:
> Say I have dict a = {'a': 2, 'c': 4, 'b': 3}
> I want to increment the values by 1 for all keys in the dictionary.
> So, should we do:>>> for k
Kottiyath:
> How do we decide whether a level of complexity is Ok or not?
I don't understand your question, but here are better ways to do what
you do:
>>> a = {'a': 2, 'c': 4, 'b': 3}
>>> for k, v in a.iteritems():
... a[k] = v + 1
...
>>> a
{'a': 3, 'c': 5, 'b': 4}
>>> b = dict((k, v+1) for k
Is there a way to turn off (either globally or explicitly per
instance) the automatic interning optimization that happens for small
integers and strings (and perhaps other types) ? I tried several
workarounds but nothing worked:
>>> 'x' is 'x'
True
>>> 'x' is 'x'+''
True
>>> 'x' is ''+'x'
True
>>>
Hello ,
This is Aniket from Techclique, a New Jersey based software
development and IT consulting firm providing top quality technical and
software professionals on a permanent and contractual basis to
Government and commercial customer including fortune 500 companies and
most of states and federal
When we say readability counts over complexity, how do we define what
level of complexity is ok?
For example:
Say I have dict a = {'a': 2, 'c': 4, 'b': 3}
I want to increment the values by 1 for all keys in the dictionary.
So, should we do:
>>> for key in a:
... a[key] = a[key] + 1
or is it Ok to
Adam wrote:
> David, would you believe that I just posted about this very idea, It
> doesn't seem to have shown up yet, though. This idea works from the
> perspective of being trivially easy to implement. I can easily write
> a metaclass that looks in the namespace for methods with names that
>
sorry, ignore that. hit send before thinking properly.
> have you looked in operators? that might avoid the need for a class.
--
http://mail.python.org/mailman/listinfo/python-list
have you looked in operators? that might avoid the need for a class.
Jim Garrison wrote:
> S Arrowsmith wrote:
>> Jim Garrison wrote:
>>> It's a shame the iter(o,sentinel) builtin does the
>>> comparison itself, instead of being defined as iter(callable,callable)
>>> where the second argument
S Arrowsmith wrote:
Jim Garrison wrote:
It's a shame the iter(o,sentinel) builtin does the
comparison itself, instead of being defined as iter(callable,callable)
where the second argument implements the termination test and returns a
boolean. This would seem to add much more generality... is
On Mar 18, 5:56 pm, Scott David Daniels wrote:
> someone wrote:
> > what is good :) style for multiline queries to database?...
> > query = """ SELECT * FROM (
> > SELECT a.columna, a.columnb, a.iso
> > FROM all a
> > WHERE (a.name = L
Scott David Daniels wrote:
> someone wrote:
>> what is good :) style for multiline queries to database?...
>> query = """ SELECT * FROM (
>>SELECT a.columna, a.columnb, a.iso
>> FROM all a
>> WHERE (a.name = LOWER(%s)) ) AS c
>>
someone wrote:
what is good :) style for multiline queries to database?...
query = """ SELECT * FROM (
SELECT a.columna, a.columnb, a.iso
FROM all a
WHERE (a.name = LOWER(%s)) ) AS c
JOIN other as b on c.gid = b.id
Jim Garrison wrote:
>It's a shame the iter(o,sentinel) builtin does the
>comparison itself, instead of being defined as iter(callable,callable)
>where the second argument implements the termination test and returns a
>boolean. This would seem to add much more generality... is
>it worthy of a PEP
In article ,
Peter Otten <__pete...@web.de> wrote:
>mattia wrote:
>>
>> cpop += [nchromosome1] + [nchromosome2]
>
>I'd write that as
>
>cpop.append(nchromosome1)
>cpop.append(nchromosome2)
>
>thus avoiding the intermediate lists.
You could also write it as
cpop += [nchromosome1, nchromo
Andrii V. Mishkovskyi wrote:
Just before you start writing a PEP, take a look at `takewhile'
function in `itertools' module. ;)
OK, after reading the itertools docs I'm not sure how to use it
in this context. takewhile() requires a sequence, and turning
f.read(bufsize) into an iterable require
> Walther Neuper (WN) wrote:
>WN> Hi,
>WN> loving Java (oo) as well as SML (fun) I use to practice both of them
>WN> separately.
>WN> Now, with Python I would like to combine 'oo.extend()' with 'functional
>WN> map':
>WN> Python 2.4.4 (#2, Oct 22 2008, 19:52:44)
>WN> [GCC 4.1.2 20061115 (pre
On Wed, Mar 18, 2009 at 5:51 PM, Jim Garrison wrote:
> Jim Garrison wrote:
>>
>> Luis Zarrabeitia wrote:
>>>
>>> On Tuesday 17 March 2009 06:04:36 pm Jim Garrison wrote:
>>> with open(filename, "rb") as f:
>>> for buf in iter(lambda: f.read(1000),''):
>>> do_something(buf)
>>
>> This is
Duncan Booth wrote:
> Armin wrote:
>
> > Could you give an example of next() with a sentinel and describe its
> > use case please? I have a little trouble understanding what you guys
> > mean!
>
> It means you don't have to worry about next() throwing StopIteration.
>
> e.g.
> >>> def pairs
Jim Garrison wrote:
Luis Zarrabeitia wrote:
On Tuesday 17 March 2009 06:04:36 pm Jim Garrison wrote:
with open(filename, "rb") as f:
for buf in iter(lambda: f.read(1000),''):
do_something(buf)
This is the most pythonic solution yet.
Thanks to all the responders who took time to po
Adam wrote:
> Hey, Cliff. Thanks for sharing this idea. Unfortunately, providing a
> way to actually call the method with the mangled name is relatively
> easy, and there are options there. The real issue, to me, seems to be
> finding a way to prevent Python from eating all but the last version
> somemilk (D) wrote:
>D> Hi everyone.
>D> I have a PHP script which works and i need to write the same in Python
>D> but SOAPpy generates a slightly different request and i'm not sure how
>D> to fix it so the server likes it.
>D> The request generated by php script looks like this (removed
On Mar 18, 2:33 pm, CJ Kucera wrote:
> bieff...@gmail.com wrote:
> > It looks like some of the C extension you are using is causing a
> > segfault or similar in python
> > interpreter (or it could be a bug in the interpreter itself, but it is
> > a lot less likely).
>
> Okay... I assume by "C ext
1 - 100 of 166 matches
Mail list logo