On 11 fév, 22:24, "LL.Snark" wrote:
> Hi,
>
> I'm looking for a pythonic way to translate this short Ruby code :
> t=[6,7,8,6,7,9,8,4,3,6,7]
> i=t.index {|x| x1000), "not found")
or
next((i for i, x in enumerate(t) if x>1000), None)
or whatever matches your needs.
Note that if you use the second o
Steven,
You make some good points and I don't disagree with you. The code is
just a transfer from some older c++ code which had all sorts of
windows menus etc, which isn't required and would make it impossible
to run (again and again). It is not an especially complicated model,
and no doubt there
On Fri, 11 Feb 2011 21:47:32 -0800, Dan Stromberg wrote:
> Did you have some sort of bad experience with pylint? Do you resent the
> 20 minutes it takes to set it up?
If you read my post more carefully and less defensively, you'll see that
nothing I said was *opposed* to the use of pylint, mere
On Fri, Feb 11, 2011 at 4:13 PM, Steven D'Aprano
wrote:
> On Fri, 11 Feb 2011 10:15:27 -0800, Dan Stromberg wrote:
>
>
>> I'd use a class rather than a dictionary - because with a class, pylint
>> (and perhaps PyChecker and pyflakes?) should be able to detect typos
>> upfront.
>
> *Some* typos. Ce
On Fri, 11 Feb 2011, Nobody wrote:
> On Thu, 10 Feb 2011 08:35:24 +, John O'Hagan wrote:
> >> > But I'm still a little curious as to why even unsuccessfully
> >> > attempting to reassign stdout seems to stop the pipe buffer from
> >> > filling up.
> >>
> >> It doesn't. If the server continues
On 2/11/2011 6:10 PM, Benjamin S Wolf wrote:
It occurred to me as I was writing a for loop that I would like to
write it in generator comprehension syntax, eg.
for a in b if c:
Already proposed and rejected. See archives for python-ideas or the
gmane.comp.python.ideas mirror.
--
Terry Ja
On 2/11/2011 4:24 PM, LL.Snark wrote:
Hi,
I'm looking for a pythonic way to translate this short Ruby code :
t=[6,7,8,6,7,9,8,4,3,6,7]
i=t.index {|x| x
What does Ruby do if there is no such element?
For Python, the answer should be either None or ValueError.
If can write it in python several
On 02/12/2011 05:20 AM, Abhishek Gulyani wrote:
When I write binary files in windows:
file = open(r'D:\Data.bin','wb')
file.write('Random text')
file.close()
and then open the file it just shows up as normal text. There is
nothing binary about it. Why is that?
Sorry if this is too much of a
On 02/11/2011 10:20 PM, Abhishek Gulyani wrote:
> When I write binary files in windows:
>
> file = open(r'D:\Data.bin','wb')
> file.write('Random text')
> file.close()
>
> and then open the file it just shows up as normal text. There is nothing
> binary about it. Why is that?
>
> Sorry if this
When I write binary files in windows:
file = open(r'D:\Data.bin','wb')
file.write('Random text')
file.close()
and then open the file it just shows up as normal text. There is nothing
binary about it. Why is that?
Sorry if this is too much of a noobie question. I tried googling around but
couldn
thank u for your reply.
yeah, my end goal is something like screen scraping a web site.
Duplicating the Javascript behaviour in my Python code will be a huge
burden,I'm afraid time can't aford it.
someone say that webkit / pamie and other browser engine can render js
to html,but pamie is only wo
On Fri, 11 Feb 2011 01:29:02 -0500, Chris Jones wrote:
>> >> labelfont = '-Adobe-Helvetica-Bold-R-Normal-*-140-*'
[...]
> First of all, you need to know precisely what the above font name coding
> means.
[...]
> http://www.archive.org/details/xwindowsytemosf03querarch
Thanks for the link, th
On Fri, 11 Feb 2011 16:59:52 -0700, Ian Kelly wrote:
> Why not allow the same thing in for-loop conditions?
Because new syntax and new language features means more work. Somebody
has to write the code, make sure that it doesn't break existing Python
code, test it for bugs, change the document
On Fri, 11 Feb 2011 16:31:09 -0800, Martin De Kauwe wrote:
> The 100+ parameters just means "everything" can be adjusted outside of
> the code, invariable most of it isn't.
If people aren't going to change all these parameters, why are you
spending the time and energy writing code for something
On Feb 12, 11:13 am, Steven D'Aprano wrote:
> On Fri, 11 Feb 2011 10:15:27 -0800, Dan Stromberg wrote:
> > I'd use a class rather than a dictionary - because with a class, pylint
> > (and perhaps PyChecker and pyflakes?) should be able to detect typos
> > upfront.
>
> *Some* typos. Certainly not
On 11/02/2011 21:50, Sherm Pendley wrote:
"Martin v. Loewis" writes:
Am 11.02.2011 19:41, schrieb Craig Yoshida:
what kind of memory limitations to processes running on 32-bit python
(with 32-bit C extensions like scipy) have on 64-bit Windows? I'm
having occasional MemoryErrors when runnin
Sorry I should have added a little more example to help with clarity?
So after reading the .INI file I then initialise the objects I
described e.g.
def initialise_simulation(self):
"""Set the initial conditions.
using values from the .ini value set the C and N pools
and other misc st
On 11/02/2011 22:24, LL.Snark wrote:
Hi,
I'm looking for a pythonic way to translate this short Ruby code :
t=[6,7,8,6,7,9,8,4,3,6,7]
i=t.index {|x| x=t[0] : i+=1
... not pythonic I think...
Or :
t=[6,7,8,6,7,9,8,4,3,6,7]
i=[j for j in range(len(t)) if t[j]
Thx for your answers.
May I add s
On Fri, 11 Feb 2011 10:15:27 -0800, Dan Stromberg wrote:
> I'd use a class rather than a dictionary - because with a class, pylint
> (and perhaps PyChecker and pyflakes?) should be able to detect typos
> upfront.
*Some* typos. Certainly not all.
The more complex the code -- and with 100 or so
On Fri, Feb 11, 2011 at 4:47 PM, Westley Martínez wrote:
> No, too confusing. Then people'll want compound loops e.g.:
>
> for a in b if c while d else return x:
> print('Ha ha I'm so clever!')
I've yet to see anybody arguing for while loops to be nested like
that, but we already allow nested
Hi,
yes I read a .INI file using ConfigParser, just similar sections (in
my opinion) to make one object which i can then pass to different
classes. E.G.
class Dict2Obj:
""" Turn a dictionary into an object.
The only purpose of this is that I think it is neater to reference
values
x.s
On Fri, 2011-02-11 at 15:10 -0800, Benjamin S Wolf wrote:
> It occurred to me as I was writing a for loop that I would like to
> write it in generator comprehension syntax, eg.
>
> for a in b if c:
>
> rather than using one of the more verbose but allowable syntaxes:
>
> for a in (x for x in
On Feb 11, 11:10 pm, Benjamin S Wolf wrote:
> It occurred to me as I was writing a for loop that I would like to
> write it in generator comprehension syntax, eg.
>
> for a in b if c:
>
> rather than using one of the more verbose but allowable syntaxes:
>
> for a in (x for x in b if c):
>
>
On Feb 11, 9:24 pm, "LL.Snark" wrote:
> Hi,
>
> I'm looking for a pythonic way to translate this short Ruby code :
> t=[6,7,8,6,7,9,8,4,3,6,7]
> i=t.index {|x| x
> If you don't know Ruby, the second line means :
> What is the index, in array t, of the first element x such that x
> If can write it
It occurred to me as I was writing a for loop that I would like to
write it in generator comprehension syntax, eg.
for a in b if c:
rather than using one of the more verbose but allowable syntaxes:
for a in (x for x in b if c):
for a in b:
if not c: continue
Python 3.1 does not suppo
On Fri, 11 Feb 2011 07:06:11 -0800, christian.posta wrote:
> Within the __call__ function for a class, I saw a method of that class
> referred to like this:
>
> *self.()
>
> The brackets indicate the method name. What does the *self refer to??
> Does it somehow indicate the scope of the 'self' v
"LL.Snark" writes:
> I'm looking for a pythonic way to translate this short Ruby code :
> t=[6,7,8,6,7,9,8,4,3,6,7]
> i=t.index {|x| x=t[0], t).next()
Note the above can throw an exception if no suitable element is found.
t=[6,7,8,6,7,9,8,4,3,6,7]
i=[j for j in range(len(t)) if t[j]http
On Fri, Feb 11, 2011 at 1:51 PM, Dan Stromberg wrote:
> On Fri, Feb 11, 2011 at 1:43 PM, André Roberge
> wrote:
>> On Friday, February 11, 2011 5:24:15 PM UTC-4, LL.Snark wrote:
>>> Hi,
>>>
>>> I'm looking for a pythonic way to translate this short Ruby code :
>>> t=[6,7,8,6,7,9,8,4,3,6,7]
>>> i
On Fri, Feb 11, 2011 at 1:51 PM, Dan Stromberg wrote:
> On Fri, Feb 11, 2011 at 1:43 PM, André Roberge
> wrote:
> > On Friday, February 11, 2011 5:24:15 PM UTC-4, LL.Snark wrote:
> >> Hi,
> >>
> >> I'm looking for a pythonic way to translate this short Ruby code :
> >> t=[6,7,8,6,7,9,8,4,3,6,7]
On Feb 11, 2:24 pm, "LL.Snark" wrote:
> Hi,
>
> I'm looking for a pythonic way to translate this short Ruby code :
> t=[6,7,8,6,7,9,8,4,3,6,7]
> i=t.index {|x| xhttp://mail.python.org/mailman/listinfo/python-list
"Martin v. Loewis" writes:
> Am 11.02.2011 19:41, schrieb Craig Yoshida:
>> what kind of memory limitations to processes running on 32-bit python
>> (with 32-bit C extensions like scipy) have on 64-bit Windows? I'm
>> having occasional MemoryErrors when running a python program on
>> 64-bit Win
On Fri, Feb 11, 2011 at 1:43 PM, André Roberge wrote:
> On Friday, February 11, 2011 5:24:15 PM UTC-4, LL.Snark wrote:
>> Hi,
>>
>> I'm looking for a pythonic way to translate this short Ruby code :
>> t=[6,7,8,6,7,9,8,4,3,6,7]
>> i=t.index {|x| x>
>> If you don't know Ruby, the second line means
On Fri, Feb 11, 2011 at 1:24 PM, LL.Snark wrote:
> Hi,
>
> I'm looking for a pythonic way to translate this short Ruby code :
> t=[6,7,8,6,7,9,8,4,3,6,7]
> i=t.index {|x| x
> If you don't know Ruby, the second line means :
> What is the index, in array t, of the first element x such that x
> If ca
On Friday, February 11, 2011 5:24:15 PM UTC-4, LL.Snark wrote:
> Hi,
>
> I'm looking for a pythonic way to translate this short Ruby code :
> t=[6,7,8,6,7,9,8,4,3,6,7]
> i=t.index {|x| x
> If you don't know Ruby, the second line means :
> What is the index, in array t, of the first element x such
Hi,
I'm looking for a pythonic way to translate this short Ruby code :
t=[6,7,8,6,7,9,8,4,3,6,7]
i=t.index {|x| x=t[0] : i+=1
... not pythonic I think...
Or :
t=[6,7,8,6,7,9,8,4,3,6,7]
i=[j for j in range(len(t)) if t[j]http://mail.python.org/mailman/listinfo/python-list
Am 11.02.2011 19:41, schrieb Craig Yoshida:
> what kind of memory limitations to processes running on 32-bit python
> (with 32-bit C extensions like scipy) have on 64-bit Windows? I'm
> having occasional MemoryErrors when running a python program on
> 64-bit Windows 7 that runs fine on my OS X ma
hey, does anyone find the UML useful during Python development of larger
projects?
--
http://mail.python.org/mailman/listinfo/python-list
Martin De Kauwe wrote:
Hi,
I have a series of parameter values which i need to pass throughout my
code (>100), in C I would use a structure for example. However in
python it is not clear to me if it would be better to use a dictionary
or build a class object? Personally I think accessing the val
Il giorno 11/feb/2011, alle ore 19.47, Ethan Furman ha scritto:
>
> I strongly disagree. Code readability is one of the most important issues.
Perfectly agree with that, but
obj.name = x
obj.surname = y
obj['name'] = x
obj['surname'] = y
are both quite readable in my opinion.
Other things a
Hmmm.
Is it just us that read this topic and think of an object with a psychic
disorder like multiple personalities?
:):
TGIF.
Uli
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
Python 32 bits (& Pywin32) limits are:
2 GB on win.7_32 bits
4 GB on win.7_64 bits
That's what I found in my tests.
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
Appreciate the responses, guys.
I now see the difference between the ways I was trying to call
function(s).
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
> I have a series of parameter values which i need to pass throughout my
> code (>100), in C I would use a structure for example. However in
> python it is not clear to me if it would be better to use a dictionary
> or build a class object?
namedtuple can be a quick and easy solution for you.
http:
>From an old-time Smalltalker / object guy, take this for whatever it's worth.
The *primary* reason for going with a class over a dictionary is if there is
specific behavior that goes along with these attributes.
If there isn't, if this is "just" an 'object store', there's no reason not to
use a
what kind of memory limitations to processes running on 32-bit python (with
32-bit C extensions like scipy) have on 64-bit Windows? I'm having occasional
MemoryErrors when running a python program on 64-bit Windows 7 that runs fine
on my OS X machine. Both machines are using a 64-bit OS and h
Andrea Crotti wrote:
On Feb 11, 3:56 pm, Martin De Kauwe wrote:
Hi,
I have a series of parameter values which i need to pass throughout my
code (>100), in C I would use a structure for example. However in
python it is not clear to me if it would be better to use a dictionary
or build a class o
On Thu, 10 Feb 2011 08:35:24 +, John O'Hagan wrote:
>> > But I'm still a little curious as to why even unsuccessfully attempting
>> > to reassign stdout seems to stop the pipe buffer from filling up.
>>
>> It doesn't. If the server continues to run, then it's ignoring/handling
>> both SIGPIPE
or Module;-?
On 2/11/2011 9:56 AM, Martin De Kauwe wrote:
Hi,
I have a series of parameter values which i need to pass throughout my
code (>100), in C I would use a structure for example. However in
python it is not clear to me if it would be better to use a dictionary
or build a class object?
Il giorno 11/feb/2011, alle ore 17.01, Martin De Kauwe ha scritto:
>
> i have a number some are smaller, for example switch/control flags.
> But the rest can be quite large. I can split them but I don't see the
> advantage particularly. Currently by using them (e.g.
> params.rate_of_decomp) it cl
> So speed up the compile-test cycle I'm thinking about running a
> completely separate process (not a fork, but a processed launched form
> a different terminal) that can load the cache once then dunk it in an
> area of shareed memory.Each time I debug the main program, it can
> start up quick
On Fri, Feb 11, 2011 at 6:56 AM, Martin De Kauwe wrote:
> Hi,
>
> I have a series of parameter values which i need to pass throughout my
> code (>100), in C I would use a structure for example. However in
> python it is not clear to me if it would be better to use a dictionary
> or build a class o
On 12/4/2010 5:42 PM, Jorge Biquez wrote:
Hello all.
Newbie question. Sorry.
As part of my process to learn python I am working on two personal
applications. Both will do it fine with a simple structure of data
stored in files. I now there are lot of databases around I can use but I
would like
On Feb 11, 9:57 am, "christian.posta"
wrote:
> On Feb 11, 9:10 am, Robert Kern wrote:
>
>
>
> > On 2/11/11 9:06 AM, christian.posta wrote:
>
> > > I searched quickly to see whether this may have been discussed before,
> > > but it's possible my search criteria was not refined enough to get any
>
On Feb 11, 9:10 am, Robert Kern wrote:
> On 2/11/11 9:06 AM, christian.posta wrote:
>
>
>
> > I searched quickly to see whether this may have been discussed before,
> > but it's possible my search criteria was not refined enough to get any
> > hits. Forgive me if this is a silly question..
>
> > I
On Feb 11, 9:10 am, Robert Kern wrote:
> On 2/11/11 9:06 AM, christian.posta wrote:
>
>
>
> > I searched quickly to see whether this may have been discussed before,
> > but it's possible my search criteria was not refined enough to get any
> > hits. Forgive me if this is a silly question..
>
> > I
On Feb 11, 9:10 am, Robert Kern wrote:
> On 2/11/11 9:06 AM, christian.posta wrote:
>
>
>
> > I searched quickly to see whether this may have been discussed before,
> > but it's possible my search criteria was not refined enough to get any
> > hits. Forgive me if this is a silly question..
>
> > I
In article <4d3c8d53$0$44021$742ec...@news.sonic.net>,
John Nagle wrote:
>
> Google's BigTable and Facebook's Cassandra offer impressive
>performance at very large scale. But they're way overkill for
>a desktop app. Even the midrange systems, like CouchDB, are
>far too much machinery for a
On Feb 11, 6:27 am, Adam Skutt wrote:
> On Feb 10, 9:30 am, "Charles Fox (Sheffield)"
> wrote:
>
> > But when I look at posix_ipc and POSH it looks like you have to fork
> > the second process from the first one, rather than access the shared
> > memory though a key ID as in standard C unix share
On Feb 11, 2:06 am, Alexander Gattin wrote:
> Hello,
>
> On Tue, Feb 08, 2011 at 05:32:05PM +, Icarus
>
> Sparry wrote:
> > The key thing which makes this 'modern' is the
> > '+' at the end of the command, rather than '\;'.
> > This causes find to execute the grep once per
> > group of files,
On 2/11/11 9:06 AM, christian.posta wrote:
I searched quickly to see whether this may have been discussed before,
but it's possible my search criteria was not refined enough to get any
hits. Forgive me if this is a silly question..
I was reading some Python code from a third-party app for the dj
Hi All,
I'm happy to announce a new release of TestFixtures.
This release adds a helper for tests of code using zope.component:
http://packages.python.org/testfixtures/components.html
The package is on PyPI and a full list of all the links to docs, issue
trackers and the like can be found her
On Feb 12, 2:40 am, Andrea Crotti wrote:
> On Feb 11, 3:56 pm, Martin De Kauwe wrote:
>
> > Hi,
>
> > I have a series of parameter values which i need to pass throughout my
> > code (>100), in C I would use a structure for example. However in
> > python it is not clear to me if it would be better
On 2/11/2011 8:06 AM, christian.posta wrote:
I searched quickly to see whether this may have been discussed before,
but it's possible my search criteria was not refined enough to get any
hits. Forgive me if this is a silly question..
I was reading some Python code from a third-party app for the
On Feb 11, 3:56 pm, Martin De Kauwe wrote:
> Hi,
>
> I have a series of parameter values which i need to pass throughout my
> code (>100), in C I would use a structure for example. However in
> python it is not clear to me if it would be better to use a dictionary
> or build a class object? Person
I searched quickly to see whether this may have been discussed before,
but it's possible my search criteria was not refined enough to get any
hits. Forgive me if this is a silly question..
I was reading some Python code from a third-party app for the django
project... i saw this in the code and I
Hi,
I have a series of parameter values which i need to pass throughout my
code (>100), in C I would use a structure for example. However in
python it is not clear to me if it would be better to use a dictionary
or build a class object? Personally I think accessing the values is
neater (visually)
On 11/02/2011 04:34, Roland Mueller wrote:
Hello,
On 02/07/2011 06:26 PM, Mauro Caceres wrote:
>>> import re
>>> help(re.findall)
Help on function findall in module re:
findall(pattern, string, flags=0)
Return a list of all non-overlapping matches in the string.
If one or more groups are prese
DataSmash wrote:
Can someone help me understand why Example #1 & Example #2 will run
the functions,
while Example #3 DOES NOT?
Thanks for your time!
R.D.
def One():
print "running fuction 1"
def Two():
print "running fuction 2"
def Three():
print "running fuction 3"
# Example #1
fL
Chris Rebert writes:
> It's a well-known problem due to the intricacies of Python's scoping
> rules.
Actually, it is not specific to Python's scoping rules (which mandate
local, then module-level, then built-in name lookup). The root of the
surprise is, as you correctly point out, the fact that
> Can someone help me understand why Example #1 & Example #2 will run
> the functions,
> while Example #3 DOES NOT?
> Thanks for your time!
> R.D.
>
> def One():
> print "running fuction 1"
> def Two():
> print "running fuction 2"
> def Three():
> print "running fuction 3"
>
>
> # Ex
On Feb 11, 9:15 am, DataSmash wrote:
> Can someone help me understand why Example #1 & Example #2 will run
> the functions,
> while Example #3 DOES NOT?
> Thanks for your time!
> R.D.
>
> def One():
> print "running fuction 1"
> def Two():
> print "running fuction 2"
> def Three():
> p
Can someone help me understand why Example #1 & Example #2 will run
the functions,
while Example #3 DOES NOT?
Thanks for your time!
R.D.
def One():
print "running fuction 1"
def Two():
print "running fuction 2"
def Three():
print "running fuction 3"
# Example #1
fList = ["Two()","Thr
On Feb 11, 1:39 pm, Vlastimil Brom wrote:
> (wxPython-specific questions may be rather discussed on that
> maillist:http://groups.google.com/group/wxpython-users/topics?pli=1
Just the ticket! Many thanks!
--
http://mail.python.org/mailman/listinfo/python-list
2011/2/11 Mark Carter :
> Is there a way of testing whether a frame (suppose I have it as a
> variable my_frame) is hidden in wxPython?
>
> Also, is there a way that I can over-ride the close button so that the
> frame becomes hidden rather than destroyed, and perform supplementary
> tests?
> --
>
Steven D'Aprano schrieb:
On Thu, 10 Feb 2011 15:48:47 +, Cousin Stanley wrote:
Steven D'Aprano wrote:
I have a tkinter application under Python 2.6 which is shows text in a
giant font, about twenty(?) times larger than expected.
The fonts are set using:
titlefont = '-Adobe-Helvetica-B
On Feb 11, 5:52 am, "Charles Fox (Sheffield)"
wrote:
> On Feb 10, 6:22 pm, Jean-Paul Calderone
> wrote:
>
>
>
>
>
>
>
>
>
> > On Feb 10, 12:21 pm, "Charles Fox (Sheffield)"
> > wrote:
>
> > > On Feb 10, 3:43 pm, Jean-Paul Calderone
> > > wrote:
>
> > > > On Feb 10, 9:30 am, "Charles Fox (Sheffi
Is there a way of testing whether a frame (suppose I have it as a
variable my_frame) is hidden in wxPython?
Also, is there a way that I can over-ride the close button so that the
frame becomes hidden rather than destroyed, and perform supplementary
tests?
--
http://mail.python.org/mailman/listinf
On 2011-02-07 18:46:17 -0500, Josh English said:
I found the code posted at
http://infix.se/2007/02/06/gentlemen-indent-your-xml
quite helpful in turning my xml into human-readable structures. It works
best for XML-Data.
lxml, which the code is using, already has a pretty_print feature
acc
On Feb 10, 9:30 am, "Charles Fox (Sheffield)"
wrote:
>
> But when I look at posix_ipc and POSH it looks like you have to fork
> the second process from the first one, rather than access the shared
> memory though a key ID as in standard C unix shared memory. Am I
> missing something? Are there
On Feb 10, 6:22 pm, Jean-Paul Calderone
wrote:
> On Feb 10, 12:21 pm, "Charles Fox (Sheffield)"
> wrote:
>
>
>
> > On Feb 10, 3:43 pm, Jean-Paul Calderone
> > wrote:
>
> > > On Feb 10, 9:30 am, "Charles Fox (Sheffield)"
> > > wrote:
>
> > > > Hi guys,
> > > > I'm working on debugging a large py
On 11/02/2011 08:19, Steven D'Aprano wrote:
[...]
Re-writing them as normal function defs may help. I'm going to do them in
reverse order:
# lambda: f(k)
def func():
return f(k)
When you call func() with no arguments, the body is executed and f(k) is
returned. Where do f and k come from?
Hello,
On Tue, Feb 08, 2011 at 05:32:05PM +, Icarus
Sparry wrote:
> The key thing which makes this 'modern' is the
> '+' at the end of the command, rather than '\;'.
> This causes find to execute the grep once per
> group of files, rather than once per file.
many thanks to you, man!
I'm surp
Hello,
On Thu, Feb 10, 2011 at 07:52:34AM +0100, Petter
Gustad wrote:
> r...@rpw3.org (Rob Warnock) writes:
> > invocation was given only one arg!! IT FOUND
> > THE PATTERN, BUT DIDN'T TELL ME WHAT
> > !@^%!$@#@! FILE IT WAS IN!! :-{
>
> Sounds frustrating, but grep -H will always
> print the fi
Rotwang writes:
> On 11/02/2011 05:42, Ben Finney wrote:
> > What part is inelegant to your eye?
>
> I guess the fact that it exploits the way Python evaluates default
> function arguments to achieve something other than what they were
> intended for.
I see. If that seems like an exploit, I can
On 2/10/11 7:34 PM, alex23 wrote:
> rantingrick wrote:
>> 1. When has 2 bytecode instructions EVER out weighed a solid
>> readability feature's incorporation into Python?
>
> The original point was whether or not the code is identical, which
> Terry showed it was not.
Rick does not understand wh
On 2/10/11 7:15 PM, rantingrick wrote:
> I am *seriously* ...blah
You are a child.
This is your second pointless response to this thread.
Part of me wants to say, stop behaving like a 13 year old; only you're
behaving worse then several 13 year olds I know. It would be an insult
to their maturit
hi,
I wanna get attribute value like href,src... in html.
for simple html page libxml2dom can help me parse it into dom, and
get what I want;
but for some pages rendered by js, like:
document.write(
''+
''+
''+
''+
''+
''+
''+
''+
''+
''+
''+
''
)
how can I get the atrribute v
hi,
I wanna get attribute value like href,src... in html.
for simple html page libxml2dom can help me parse it into dom, and
get what I want;
but for some pages rendered by js, like:
document.write(
''+
''+
''+
''+
''
On Fri, 11 Feb 2011 06:32:56 +, Rotwang wrote:
> I don't understand why this works. What is the difference between
>
> (lambda x: lambda: f(x))(k)
>
> and
>
> lambda: f(k)
>
> ?
Re-writing them as normal function defs may help. I'm going to do them in
reverse order:
# lambda:
Dennis Lee Bieber writes:
>> menu.add_command(label = str(k), command = lambda: f(k))
> I'm not sure, but what effect does
> menu.add_command(label=str(k), command = lambda k=k: f(k))
> have on the processing.
In the first example, k is a free variable in the lambda,
91 matches
Mail list logo