Ian Kelly wrote:
> On Wed, Jul 6, 2011 at 12:49 AM, Ulrich Eckhardt
> wrote:
>> Mel wrote:
>>> In wx, many of the window classes have Create methods, for filling in
>>> various attributes in "two-step construction". [...]
>>
>> Just guessing, is it legacy, C-with-classes code rather than C++ code
Chris Angelico wrote:
>
>
> http://blah/blah";>
> http://another/blah";>
>
>
> http://third/blah";>
> http://final/blah";>
>
>
>
> That should divide your screen four ways
> ( if I haven't botched my HTML
> - ages since I've used frames ).
html !botched :-
Hi Folks,
Here is something I don't fully understand.
1 def DefaultTracer(fmt, *args):
2 fmt = 'in DefaultTracer ' + fmt
3 print(fmt % args)
4 pass
5 def myTracer(fmt, *args):
6 fmt = 'in myTracer ' + fmt
7 print(fmt % args)
8
9 class MyClass:
10 ClassDefaultTracer
I can understand why it's frustrating but a menu items with icons on them
aren't exactly common, so you're wandering into territory that's probably not
so throughly explored (nor standard across platforms). Now that I think about
it, I don't know that I've ever seen one under OSX, and I don't
Hello,
I've been programming in Python for a few years now. I have read most the
typical learning resources, such as 'Dive Into Python', 'A Byte of Python',
etc. In general I feel I have a good overview of the language. However, as I
advanced toward trying to create more OO styled programs, I fee
Kannan Varadhan wrote:
> Here is something I don't fully understand.
>
> 1 def DefaultTracer(fmt, *args):
> 2 fmt = 'in DefaultTracer ' + fmt
> 3 print(fmt % args)
> 4 pass
> 5 def myTracer(fmt, *args):
> 6 fmt = 'in myTracer ' + fmt
> 7 print(fmt % args)
> 8
> 9 class
Billy Mays wrote:
> On 07/06/2011 04:02 PM, Ian Kelly wrote:
>> According to Wikipedia:
>>
>> """
>> In practice the Schönhage–Strassen algorithm starts to outperform
>> older methods such as Karatsuba and Toom–Cook multiplication for
>> numbers beyond 2**2**15 to 2**2**17 (10,000 to 40,000 decimal
Hi All ,
Could any one help to get max and min values from a specified column of a
csv file. The* csv file is large* and hence the below code did go bad.
*Alternate
methods would be highly appreciated
**
minimum.py*:
import csv
filename = "testLog_4.csv"
f = open(filename)
def col_min(mincname):
On 2011-04-20, Bill Marcum wrote:
> On 2011-04-20, Adam Funk wrote:
>> I'd appreciate any suggestions for testing (preferably from a bash
>> script, although perl or python would be OK too) whether anyone is
>> currently logged in, and whether anyone has been logged in during the
>> past $N minut
I think you would benefit from reading the data into a numpy array first,
then using numpy min, max functions.
prakash jp wrote:
>
> Hi All ,
>
> Could any one help to get max and min values from a specified column of a
> csv file. The* csv file is large* and hence the below code did go bad.
John [H2O] wrote:
[ ... ]
> What are the key points to the classes? Is it okay to reference or pass
> classes to instantiate a class?
Yes. The standard library does this in BaseHTTPServer (via its parent
SocketServer.) Maybe looks abstruse at the outset, but it's the natural way
to assign a f
Mel writes:
> def file_to_hash(path, m = hashlib.md5()):
>
> hashlib.md5 *is* called once; that is when the def statement is executed.
Very interesting, I certainly wasn't clear on this. So after that def,
the created hashlib object is in the module's scope and can be
accessed via file_to_hash._
hi all,
I feel lack of native Python lists operations (e.g. taking N greatest
elements with the involved key function and O(n) speed) and
occasionally found blist
http://pypi.python.org/pypi/blist/
Its entry says it is better than Python list. Did anyone ensure?
Will it ever be merged into Python s
Anssi Saari writes:
> Mel writes:
>
>> def file_to_hash(path, m = hashlib.md5()):
>>
>> hashlib.md5 *is* called once; that is when the def statement is executed.
>
> Very interesting, I certainly wasn't clear on this. So after that def,
> the created hashlib object is in the module's scope and c
prakash jp wrote:
> Could any one help to get max and min values from a specified column of a
> csv file. The* csv file is large* and hence the below code did go bad.
> *Alternate
> methods would be highly appreciated
> **
> minimum.py*:
> import csv
> filename = "testLog_4.csv"
> f = open(filenam
Kannan Varadhan wrote:
> Hi Folks,
>
> Here is something I don't fully understand.
>
> 1 def DefaultTracer(fmt, *args):
> 2 fmt = 'in DefaultTracer ' + fmt
> 3 print(fmt % args)
> 4 pass
> 5 def myTracer(fmt, *args):
> 6 fmt = 'in myTracer ' + fmt
> 7 print(fmt % args)
P
Steven D'Aprano writes:
> Please don't post code with line numbers. That makes it difficult to copy
> and paste your function into an interactive session, so that we can run it
> and see what it does.
C-x r d
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.07.06 06:16 PM, Steven D'Aprano wrote:
> Phlip wrote:
>
> > Note the fix also avoids comparing to None, which, as usual, is also
> > icky and less typesafe!
>
> "Typesafe"? Are you trying to make a joke?
Maybe he has a duck phobia. Maybe he denies the existence of ducks.
Maybe he doesn't li
Peter Otten wrote:
> or you wrap the callable in a descriptor:
>
def DefaultTracer(*args): print args
> ...
class D(object):
> ... def __init__(self, f):
> ... self.f = f
> ... def __get__(self, *args):
> ... return self.f
> ...
After skimming over Steve
> On 2011.07.06 06:16 PM, Steven D'Aprano wrote:> Phlip wrote:
>
> > > Note the fix also avoids comparing to None, which, as usual, is also
> > > icky and less typesafe!
>
> > "Typesafe"? Are you trying to make a joke?
No, I was pointing out that passing a type is more ... typesafe.
--
http://ma
On 2011.07.07 08:11 AM, Phlip wrote:
> No, I was pointing out that passing a type is more ... typesafe.
None is a type.
>>> None.__class__
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 7, 6:24 am, Andrew Berg wrote:
> On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that passing a
> type is more ... typesafe.
>
> None is a type.
I never said it wasn't.
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.07.07 08:39 AM, Phlip wrote:
> On Jul 7, 6:24 am, Andrew Berg wrote:
> > On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that passing a
> > type is more ... typesafe.
> >
> > None is a type.
>
> I never said it wasn't.
You are talking about this code, right?
def file_to_hash
On 2011-07-06, Waldek M. wrote:
> Dnia Wed, 06 Jul 2011 03:36:24 +1000, Steven D'Aprano napisa?(a):
>> Because unless you are extremely disciplined, code and the comments
>> describing them get out of sync. [...]
> True, but that gets far worse with external docs. Do you have in mind
> any bette
Looking for tips and lessons learned (advice on what to do and
not do) for writing a Python based DSL.
Googling python dsl yields some wonderful content which I've just
started to read. If there are specific articles or 3rd party
libraries that you used to implement a DSL, I would appreciate
heari
For me, diving into the data model really helped me grasp some of the
metaprogramming capabilities that python has, which is helping me as I am
implementing my own DSL in python.
http://docs.python.org/reference/datamodel.html
On Thu, Jul 7, 2011 at 10:20 AM, wrote:
> Looking for tips and less
Greetings
I'm running Python (32b) in Windows7 (at 64bits) and I would like to know
how can I check if my machine is a 32b or 64b in Python. Is it possible? I
saw a few examples (like platform) but they only provide information about
Python not the machine.
Thanks
Toze
--
http://mail.python.org/m
On 2011.07.07 10:21 AM, António Rocha wrote:
> I'm running Python (32b) in Windows7 (at 64bits) and I would like to
> know how can I check if my machine is a 32b or 64b in Python. Is it
> possible? I saw a few examples (like platform) but they only provide
> information about Python not the machine
On Thu, Jul 7, 2011 at 2:30 AM, Ulrich Eckhardt
wrote:
> Even worse, most people would actually pay for its use, because they don't
> use numbers large enough to merit the Schönhage–Strassen algorithm.
As it stands, Karatsuba is only used for numbers greater than a
specific threshold. Adding Sch
On Thu, Jul 7, 2011 at 9:49 AM, Ian Kelly wrote:
> On Thu, Jul 7, 2011 at 2:30 AM, Ulrich Eckhardt
> wrote:
>> Even worse, most people would actually pay for its use, because they don't
>> use numbers large enough to merit the Schönhage–Strassen algorithm.
>
> As it stands, Karatsuba is only used
On Thu, Jul 7, 2011 at 1:12 AM, Ulrich Eckhardt
wrote:
>>> Just guessing, is it legacy, C-with-classes code rather than C++ code
>>> perhaps? Haven't looked at wx for a while. Such code typically lacks
>>> understanding of exceptions, which are the only way to signal failure
>>> from e.g. construc
Hi,
Billy Mays wrote:
>
>> On 07/06/2011 04:02 PM, Ian Kelly wrote:
>> > On Wed, Jul 6, 2011 at 1:30 PM, Billy Mays wrote:
>> >> I was looking through the python source and noticed that long
>> multiplication
>> >> is done using the Karatsuba method (O(~n^1.5)) rather than using FFTs
>> O(~n
>
On Thu, 07 Jul 2011, Andrew Berg wrote:
> On 2011.07.07 10:21 AM, António Rocha wrote:
> > I'm running Python (32b) in Windows7 (at 64bits) and I would like to
> > know how can I check if my machine is a 32b or 64b in Python. Is it
> > possible? I saw a few examples (like platform) but they only p
On 7/7/11 11:33 AM, Philip Reynolds wrote:
On Thu, 07 Jul 2011, Andrew Berg wrote:
On 2011.07.07 10:21 AM, António Rocha wrote:
I'm running Python (32b) in Windows7 (at 64bits) and I would like to
know how can I check if my machine is a 32b or 64b in Python. Is it
possible? I saw a few example
On Thu, Jul 7, 2011 at 5:08 AM, dmitrey wrote:
> I feel lack of native Python lists operations (e.g. taking N greatest
> elements with the involved key function and O(n) speed) and
> occasionally found blist
> http://pypi.python.org/pypi/blist/
>
> Its entry says it is better than Python list.
2011/7/7 António Rocha
> Greetings
>
> I'm running Python (32b) in Windows7 (at 64bits) and I would like to know
> how can I check if my machine is a 32b or 64b in Python. Is it possible? I
> saw a few examples (like platform) but they only provide information about
> Python not the machine.
> Th
I just found the following url in my archives at work and
thought you might enjoy it:
http://thc.org/root/phun/unmaintain.html
/Martin
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 5, 5:05 pm, Thomas Jollans wrote:
> On 06/27/2011 06:59 PM, miamia wrote:
>
> > Hello,
>
> > on 32-bit windows everything works ok but on 64-bit win I am getting
> > this error:
> > Traceback (most recent call last):
> > File "app.py", line 1040, in do_this_now
> > File "kinterbasdb\__i
Have you looked at
http://docs.python.org/library/collections.html#collections.deque ?
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 7, 12:34 am, Gregory Ewing wrote:
> rantingrick wrote:
> > Yes but what benefit does that gain over say, Tkinter's design
> > (because that has been your argument).
>
> Like I said, it's a tangential issue.
Agreed.
> The important thing is that it's okay for an app to stay
> alive until i
On Jul 7, 1:30 am, Ulrich Eckhardt
wrote:
> Billy Mays wrote:
> > On 07/06/2011 04:02 PM, Ian Kelly wrote:
> >> According to Wikipedia:
>
> >> """
> >> In practice the Schönhage–Strassen algorithm starts to outperform
> >> older methods such as Karatsuba and Toom–Cook multiplication for
> >> numbe
I use cached dns lookups with pdnsd on my ubuntu machine to speed up web
access as regular lookups can take 15-30 seconds. However, python's
mechanize and urllib etc use socket.getaddrinfo, which seems not to be using
dns cacheing or taking a long time because of ipv6 lookups. In either case,
I sub
I have this simple palindrome program that yields different results
depending on whether I run it from Windows or from IDLE. The answer
is correct off IDLE, but why is this the case? Here's the code:
def reverse(text):
return text[::-1]
def is_palindrome(text):
return text==reverse(text)
On Fri, Jul 8, 2011 at 3:29 AM, rantingrick wrote:
> So your argument is:
> """ A window hierarchy is bad because if your application requires
> a user to open a gazillion windows (read as: designed poorly) --each
> representing completely different transactions-- and if you close the
> origina
On Fri, Jul 8, 2011 at 4:18 AM, high bandwidth wrote:
> I use cached dns lookups with pdnsd on my ubuntu machine to speed up web
> access as regular lookups can take 15-30 seconds. However, python's
> mechanize and urllib etc use socket.getaddrinfo, which seems not to be using
> dns cacheing or ta
On 2011.07.07 12:22 PM, Martin Schöön wrote:
> I just found the following url in my archives at work and
> thought you might enjoy it:
> http://thc.org/root/phun/unmaintain.html
That's awesome.
> If a maintenance programmer can't quote entire Monty Python movies
> from memory, he or she has *no* b
In <842fce9d-1b3f-434a-b748-a6dc4828c...@h12g2000pro.googlegroups.com> linda
writes:
> I have this simple palindrome program that yields different results
> depending on whether I run it from Windows or from IDLE. The answer
> is correct off IDLE, but why is this the case? Here's the code:
Yo
linda wrote:
I have this simple palindrome program that yields different results
depending on whether I run it from Windows or from IDLE. The answer
is correct off IDLE, but why is this the case? Here's the code:
def reverse(text):
return text[::-1]
def is_palindrome(text):
return text
On 07/07/2011 19:18, linda wrote:
I have this simple palindrome program that yields different results
depending on whether I run it from Windows or from IDLE. The answer
is correct off IDLE, but why is this the case? Here's the code:
def reverse(text):
return text[::-1]
def is_palindrome(
John Gordon wrote:
By the way, I could not make your program work as you provided it; I had
to replace input() with raw_input(). Does it really work for you this way?
input() is the 3.x name for raw_input()
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
On 07/07/2011 19:37, John Gordon wrote:
In<842fce9d-1b3f-434a-b748-a6dc4828c...@h12g2000pro.googlegroups.com>
linda writes:
I have this simple palindrome program that yields different results
depending on whether I run it from Windows or from IDLE. The answer
is correct off IDLE, but why is
Hello,
I'm trying to access a hardware board of my company through a serial
connection using a Python script and the pyserial module.
I use Python 2.7.1 with Ubuntu 11.04 (pyserial is the package python-
serial with version 2.5.2, http://pyserial.sourceforge.net/pyserial_api.html).
The board to
Hi!
I'm trying to share data between processes using
multiprocessing.Manager and
creating shared Namespace. I have the following code:
from multiprocessing import Manager
from scipy import rand
x = rand(5000, 5000)
m = Manager()
n = m.Namespace()
n.x = x
It seems that at n.x = x data is ser
I tried something = input('enter text:').rstrip('\n') as suggested but
the problem persists. BTW, the intermediate print commands agree and
so are not an issue. The disagreement is in IDLE correctly
identifying palindromes and Windows not. I do suspect it may be a
trailing '\r' issue. Is there
linda wrote:
I tried something = input('enter text:').rstrip('\n') as suggested but
the problem persists. BTW, the intermediate print commands agree and
so are not an issue. The disagreement is in IDLE correctly
identifying palindromes and Windows not. I do suspect it may be a
trailing '\r' is
On Jul 7, 2:42 pm, Ethan Furman wrote:
> linda wrote:
> > I tried something = input('enter text:').rstrip('\n') as suggested but
> > the problem persists. BTW, the intermediate print commands agree and
> > so are not an issue. The disagreement is in IDLE correctly
> > identifying palindromes and
On Jul 7, 5:08 am, dmitrey wrote:
> hi all,
> I feel lack of native Python lists operations (e.g. taking N greatest
> elements with the involved key function and O(n) speed)
Take a look at heapq.nlargest()...
> and
> occasionally found blisthttp://pypi.python.org/pypi/blist/
> Its entry says it
On Thu, Jul 7, 2011 at 7:18 AM, Grant Edwards wrote:
> On 2011-07-06, Waldek M. wrote:
>> Dnia Wed, 06 Jul 2011 03:36:24 +1000, Steven D'Aprano napisa?(a):
>
>>> Because unless you are extremely disciplined, code and the comments
>>> describing them get out of sync. [...]
>
>> True, but that gets
rantingrick wrote:
> On Jul 7, 12:34 am, Gregory Ewing wrote:
>> The important thing is that it's okay for an app to stay
>> alive until its *last* top level window is closed.
I partially disagree with Greg on this. This is not the only model: on the
Apple Mac, or any system with a similar GUI
Andrew Berg wrote:
> On 2011.07.07 08:39 AM, Phlip wrote:
>> On Jul 7, 6:24 am, Andrew Berg wrote:
>> > On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that
>> > passing a type is more ... typesafe.
>> >
>> > None is a type.
>>
>> I never said it wasn't.
Unfortunately, it isn't.
No
rantingrick wrote:
So you prefer to close a gazillion windows one by one?
If I want to close all the windows, I can use the application's
"Quit" or "Exit" command, or whatever the platform calls it.
(Note that if there is a separate instance of the application
for each window -- as was sugges
On 2011.07.07 08:46 PM, Steven D'Aprano wrote:
> None is not a type, it is an instance.
>
> >>> isinstance(None, type) # is None a type?
> False
> >>> isinstance(None, type(None)) # is None an instance of None's type?
> True
>
> So None is not itself a type, although it *has* a type:
>
> >>> type
On Jul 7, 11:36 am, Andrew Berg wrote:
> On 2011.07.07 12:22 PM, Martin Schöön wrote:> I just found the following url
> in my archives at work and
> > thought you might enjoy it:
> >http://thc.org/root/phun/unmaintain.html
>
> That's awesome.
That's "How To Write Unmaintainable Code" - a venera
> I worded that poorly. None is (AFAIK) the only instance of NoneType, but
> I should've clarified the difference.> The is operator does not compare
> types, it compares instances for identity.
None is typesafe, because it's strongly typed.
However, what's even MORE X-safe (for various values of
On Thu, Jul 7, 2011 at 12:34 PM, yorick wrote:
> Hello,
>
> I'm trying to access a hardware board of my company through a serial
> connection using a Python script and the pyserial module.
>
> I use Python 2.7.1 with Ubuntu 11.04 (pyserial is the package python-
> serial with version 2.5.2,
> htt
I bring you a source of entertaintment.Just visit the following link
and know about Bollywood actresses
www.bollywoodactresseshotpictures.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jul 8, 2011 at 4:18 AM, high bandwidth wrote:
>> I use cached dns lookups with pdnsd on my ubuntu machine to speed up
>> web access as regular lookups can take 15-30 seconds. However, python's
>> mechanize and urllib etc use socket.getaddrinfo, which seems not to be
>> using dns cacheing
67 matches
Mail list logo