On Thursday, March 1, 2012 1:38:08 AM UTC-6, Steven D'Aprano wrote:
> On Wed, 29 Feb 2012 22:41:53 -0800, John Salerno wrote:
>
> >> Yes. You must leave it out.
> >
> > Now I'm reading a Tkinter reference at
> > http://infohost.nmt.edu/tcc/help/pubs/tkinter/minimal-app.html and it
> > has this ex
On 3/1/2012 1:02, Xah Lee wrote:
i missed a point in my original post. That is, when the same operator
are adjacent. e.g. 「3 ▲ 6 ▲ 5」.
This is pointed out by Kiuhnm 〔kiuhnm03.4t.yahoo.it〕 and Tim Bradshaw.
Thanks.
though, i disagree the way they expressed it, or any sense this is
different from
Hi all,
I am writing on behalf of EuroPython Staff (www.europython.eu). We are
happy to announce that the Call for Proposals is now officially open!
DEADLINE FOR PROPOSALS: MARCH 18TH, 23:59:59 CET
For those who have never been at EuroPython (or similar conferences)
before, the Call for Proposals
Hi,
I would like to define methods using exec like this:
class A:
def __init__(self):
cmd = "def sqr(self, x):\nreturn x**2\nself.sqr = sqr\n"
exec cmd
a = A()
print a.sqr(a, 2)
This works, but I have to call sqr with a.sqr(a, 2), a.sqr(2) does not work
(TypeError: sqr()
Rolf Wester wrote:
Hi,
I would like to define methods using exec like this:
class A:
def __init__(self):
cmd = "def sqr(self, x):\nreturn x**2\nself.sqr = sqr\n"
exec cmd
a = A()
print a.sqr(a, 2)
This works, but I have to call sqr with a.sqr(a, 2), a.sqr(2) does not wo
Hi guys,
I'm Francesco and I am writing on behalf of EuroPython Staff
(www.europython.eu). We are happy to announce that the Call for
Proposals is now officially open!
DEADLINE FOR PROPOSALS: MARCH 18TH, 23:59:59 CET
For those who have never been at EuroPython (or similar conferences)
before, th
On 1 March 2012 13:07, Rolf Wester wrote:
> Hi,
>
> I would like to define methods using exec like this:
>
> class A:
> def __init__(self):
> cmd = "def sqr(self, x):\n return x**2\nself.sqr = sqr\n"
> exec cmd
> a = A()
> print a.sqr(a, 2)
>
> This works, but I have to call sq
On Thu, 01 Mar 2012 14:07:15 +0100, Rolf Wester wrote:
> Hi,
>
> I would like to define methods using exec like this:
>
> class A:
> def __init__(self):
> cmd = "def sqr(self, x):\nreturn x**2\nself.sqr = sqr\n"
> exec cmd
> a = A()
> print a.sqr(a, 2)
That's... nasty,
Xah Lee writes:
[...]
> # perl
> # in-place algorithm for reversing a list.
>
> use strict;
> use Data::Dumper;
> use POSIX; # for “floor”
>
> my @listA = qw(a b c d e f g);
>
> my $listLength = scalar @listA;
>
> for ( my $i = 0; $i < floor($listLength/2); $i++ ) {
> my $x = $listA[$i];
>
Shmuel (Seymour J.) Metz writes:
> In <87aa41k6x5@sapphire.mobileactivedefense.com>, on 02/29/2012
>at 03:15 PM, Rainer Weikusat said:
>
>>'mathematics' (an essentially outdated write-only programming
>>language dating back to the times when humans had to perform
>>computations themselv
Hi!
I have a problem with SSL and threaded os.system (rewritten to Popen but
still not working). First - the set-up:
I am using windows 2003 server with current python 2.6.
When new connection comes to my server-side application, i do accept,
and then:
self.client =
ssl.wrap_socket(self.soc
Hi,
thanks for your replies so far.
The reason to use exec is just laziness. I have quite a lot of classes
representing material data and every class has a number of parameters.
The parameter are Magnitude objects (they have a value and a unit and overloaded
special functions to correctly handle
Hello!
I'm pleased to announce version 1.2.2, a bugfix release of branch
1.2 of SQLObject.
What is SQLObject
=
SQLObject is an object-relational mapper. Your database tables are described
as classes, and rows are instances of those classes. SQLObject is meant to be
easy to use
Rolf Wester wrote:
The reason to use exec is just laziness.
The worst reason for using it. So I hope you carefully read Steven's comment
and get rid of exec() for anything serious:
<4f4f85eb$0$29989$c3e8da3$54964...@news.astraweb.com>
Ciao, Michael.
--
http://mail.python.org/mailman/listinf
Thanks, Chris. That's the algorithm I was looking for. And I will be
converting most of this data to objects. Thanks again.
-Original Message-
From: Chris Rebert [mailto:c...@rebertia.com]
Sent: Wednesday, February 29, 2012 11:44 PM
Subject: Re: Help needed: dynamically pull data from
Rolf Wester wrote:
> The reason to use exec is just laziness. I have quite a lot of classes
> representing material data and every class has a number of parameters.
> The parameter are Magnitude objects (they have a value and a unit and
> overloaded special functions to correctly handle the units)
Thank you, that really made things much easier and admittedly much less nasty
too.
Regards
Rolf
On 01/03/12 18:14, Peter Otten wrote:
> Rolf Wester wrote:
>
>> The reason to use exec is just laziness. I have quite a lot of classes
>> representing material data and every class has a number of pa
Howdy All,
Py ver - 3.2, Windows-XP . Logged in as user with admin privileges.
>From my main python program, I am running powershell program using
subprocess.Popen().
Now I have created a signal_handler() function in main python script which
will handle CTRL-C ( This works fine ).
Now when I
> Now when I put "proc.terminate()" in my signal_handler() function to
> terminate the subprocess created as well,
> It is giving me "WindowsError: [Error 5] Access is denied" error.
> I have tried with os.kill() also, same error. Tried with Popen.kill() also
> same error. Have googled a bit but c
In , on 03/01/2012
at 05:07 AM, Chiron said:
>Hmm... maybe, instead of just ridiculing him,
I'm treating him as he treats others.
>BTW, I happen to agree with you insofar as this poster not
>understanding the nature of mathematics. His comment reminds me of
>the article, "Transgressing th
In , on 03/01/2012
at 04:52 AM, Chiron said:
>Yes. That (the mathematically defined way) is a particular way, is
>it not?
No. There is no "the mathematically defined way".
>However, I wasn't specifically referring to infix/postfix/prefix or
>anything of that nature. I wasn't limiting my c
On Thu, Mar 1, 2012 at 12:07 AM, Chiron wrote:
> On Wed, 29 Feb 2012 23:10:48 -0500, Shmuel (Seymour J.) Metz wrote:
>
>> ROTF,LMAO! You obviously don't have a clue as to what Mathematics means.
>> Free hint: it doesn't mean Arithmetic. You're as bigoted as Xah Lee,
>
>
> Hmm... maybe, instead of
On Mar 1, 7:04 am, Kaz Kylheku wrote:
lisp:
(floor (/ x y)) --[rewrite]--> (floor x y)
Thanks for this interesting point.
I don't think it's a good lang design, more of a lang quirk.
similarly, in Python 2.x,
x/y
will work when both x and y are integers. Also,
x//y
works too, but that // is j
Xah Lee writes:
[...]
> similarly, in perl, either one
> require POSIX; floor(x/y);
> the require POSIX instead of Math is a quirk. But even, floor should
> really be builtin.
> or
> using a perl hack
> int(x/y)
>
> all of the above are quirks. They rely on computer engineering by-
> products (s
First of all:
http://www.youtube.com/watch?v=z5jKMEB4hHE
On Wed, Feb 29, 2012 at 12:09:16AM -0800, Xah Lee wrote:
> Now, let me tell you what operator precedence is. First of all, let's
> limit ourselfs to discuss operators that are so-called binary
> operators, which, in our context, basically m
On Feb 29, 10:41 pm, John Salerno wrote:
> I'm not sure I understand which method you are advocating. It
> sounded like you said calling Tk() explicitly is a bug.
I am saying just the opposite: Allowing the module "Tkinter" to
implicitly create a root window IF the programmer was too lazy to
cre
On Feb 29, 11:24 pm, Terry Reedy wrote:
> On 2/29/2012 10:22 PM, Rick Johnson wrote:
> > PS: I would highly suggest against using the "from Tkinter import *".
> > Instead, use "import Tkinter as tk" and prefix all module contents
> > with "tk.".
>
> I have changed the example to do that. I also s
On Mar 1, 12:14 am, John Salerno wrote:
> > What exactly is the purpose of doing that? Does Tk do some extra work that
> > a simple call to Frame won't do?
>
> More specifically, what is the benefit of doing:
>
> root = tk.Tk()
> app = Application(master=root)
> app.mainloop()
>
> as opposed to:
On Feb 29, 11:40 pm, John Salerno wrote:
> The faulty code is not my own, which is part of the reason I asked
> the question. The book I'm reading (The Quick Python Book) does not
> use it, but I saw in the Python docs that it is there, under
> "tkinter" in the Global Module Docs, "24.1.2.2. A Sim
> EXAMPLE 1: (this works, but is flawed!)
> root = tk.Tk()
> b = tk.Button(master=None, text='Sloppy Coder')
> b.pack()
> root.mainloop()
>
> EXAMPLE 2: (This is how to write code!)
> root = tk.Tk()
> widgetframe = tk.Frame(root)
> b = tk.Button(master=None, text='Sloppy Coder')
> b.pack()
On Mar 1, 9:15 pm, John Salerno wrote:
> > EXAMPLE 1: (this works, but is flawed!)
> > root = tk.Tk()
> > b = tk.Button(master=None, text='Sloppy Coder')
> > b.pack()
> > root.mainloop()
>
> > EXAMPLE 2: (This is how to write code!)
> > root = tk.Tk()
> > widgetframe = tk.Frame(root)
> > b
On Mar 1, 8:49 pm, Rick Johnson wrote:
> On Feb 29, 11:24 pm, Terry Reedy wrote:
>
> > On 2/29/2012 10:22 PM, Rick Johnson wrote:
> > > PS: I would highly suggest against using the "from Tkinter import *".
> > > Instead, use "import Tkinter as tk" and prefix all module contents
> > > with "tk.".
On 3/1/2012 9:49 PM, Rick Johnson wrote:
On Feb 29, 11:24 pm, Terry Reedy wrote:
There is a minor problem left. The hi_there Button text has underscores
because if I use spaces instead, tk surrounds the text with {bra ces}.
This seems bizarre. Is there any way to have Button text with spaces
What would you recommend I use to compare data-structures and
algorithms on space and time? (runtime)
Thanks for all suggestions,
Alec Taylor
--
http://mail.python.org/mailman/listinfo/python-list
Sorry, little technical content here, just a newly hatched programmer:
duck typing, an intro
http://www.flickr.com/photos/cskk/6799351990/in/photostream/
duck typing, resting after the demo
http://www.flickr.com/photos/cskk/6945461405/in/photostream/
Cheers,
--
Cameron Simpson DoD#743
> Hmm, it seems as though i am the latest victim of the "copy/paste
> error"! Oh well, if you were going to absorb my teachings, you would
> have absorbed them by now. I am moving on unless a new subject needs
> explaining.
Well, I've certainly absorbed your recommendation to always create the roo
On Fri, 02 Mar 2012 16:15:47 +1100, Cameron Simpson wrote:
> Sorry, little technical content here, just a newly hatched programmer:
>
> duck typing, an intro
> http://www.flickr.com/photos/cskk/6799351990/in/photostream/
I love it! Excellent!
--
Steven
--
http://mail.python.org/mailman/
On Thu, Mar 1, 2012 at 8:55 PM, Alec Taylor wrote:
> What would you recommend I use to compare data-structures and
> algorithms on space and time? (runtime)
For the latter metric, one of the profiling modules:
http://docs.python.org/library/debug.html
I'd start with timeit and go from there:
http
folks hi, apologies for picking this up so late - it's only when i
find these things through random searches that i encounter the
occasional post.
At some point wa in the distant past, g4b wrote:
> On the subject of the gui discussion mentioned here last year,
> which you get lead to if you r
This is purely for fun and learning, so I know there are probably better ways
of creating a chess program. Right now I'm just curious about my specific
question, but I'd love to hear any other advice as well.
Basically, I'm wondering if I'm using the class method properly with the move
method.
On Thu, Mar 1, 2012 at 10:00 PM, John Salerno wrote:
> This is purely for fun and learning, so I know there are probably better ways
> of creating a chess program. Right now I'm just curious about my specific
> question, but I'd love to hear any other advice as well.
>
> Basically, I'm wondering
On Fri, Mar 2, 2012 at 4:15 PM, Cameron Simpson wrote:
> Sorry, little technical content here, just a newly hatched programmer:
>
> duck typing, an intro
> http://www.flickr.com/photos/cskk/6799351990/in/photostream/
>
> duck typing, resting after the demo
> http://www.flickr.com/photos/cskk/6
On Fri, Mar 2, 2012 at 9:04 AM, Xah Lee wrote:
> One easy
> way to measure it is whether a programer can read and understand a
> program without having to delve into its idiosyncrasies.
Neither the behavior of ints nor the behavior of IEEE floating point
is a "quirk" or an "idiosyncracy". These a
> That's just a coincidence. Your supercall is ought to be: super().move()
> In contrast, super().move(self) calls the superclass instance method
> `move` with 2 arguments, both `self`, which just happens to work given
> your move() method, inside which `cls` isn't actually a class like it
> ought
Xah Lee wrote:
> fun example.
>
> in-place algorithm for reversing a list in Perl, Python, Lisp
> http://xahlee.org/comp/in-place_algorithm.html
>
> plain text follows
>
>
> What's In-place Algorithm?
>
> Xah Lee, 2012-02-29
>
> This page tells you w
Prasad, Ramit wrote:
> Hi Peter,
>
> >>> class Magnitude(object):
>
> ... def __init__(self, value):
> ... self.value = value
> ... def __call__(self, uf=1):
> ... if uf == 1:
> ... return self
> ... return self.value
> ...
>
> >>>
On Wed, 29 Feb 2012 00:09:16 -0800, Xah Lee wrote:
Xah, you won't grow even an inch taller by cutting others down.
--
I joined scientology at a garage sale!!
--
http://mail.python.org/mailman/listinfo/python-list
47 matches
Mail list logo