Re: Why is there no platform independent way of clearing a terminal?

2010-07-31 Thread Lawrence D'Oliveiro
In message , Mark Lawrence wrote: > Personally I find double clicking on an msi file rather easier. Easier than apt-get dist-upgrade? -- http://mail.python.org/mailman/listinfo/python-list

Re: Call CFUNCTYPE, class Structure, ctype, dll and Callback function problem

2010-07-31 Thread legard_new
On Jul 31, 10:22 pm, "Mark Tolonen" wrote: > "legard_new" wrote in message > > news:70faf0b4-fead-49ac-bf18-e182fd63b...@j8g2000yqd.googlegroups.com... > > > > > > > Hello, > > > I have a problem with calling Callback function with Python. I have a > > DLL file. > > > Below is a description in do

Re: Why is there no platform independent way of clearing a terminal?

2010-07-31 Thread Mark Lawrence
On 01/08/2010 06:17, Tim Harig wrote: On 2010-08-01, Lawrence D'Oliveiro wrote: In message, Tim Harig wrote: It would be rewarding as it would make writing cross-platform charactor mode applications possible. I thought Windows users were allergic to command lines. To the best of my knowle

Re: Why is there no platform independent way of clearing a terminal?

2010-07-31 Thread Tim Harig
On 2010-08-01, Lawrence D'Oliveiro wrote: > In message , Tim Harig wrote: > >> It would be rewarding as it would make writing cross-platform charactor >> mode applications possible. > > I thought Windows users were allergic to command lines. To the best of my knowledge, there have never been any

Re: Problem with Elementtree and XMLSchem instance type

2010-07-31 Thread Carl Banks
On Jul 30, 6:21 am, Roland Hedberg wrote: > Hi! > > I have the following XML snippet: > >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >     xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706"; >     xsi:type="fed:SecurityTokenServiceType"> >     > > > This part aft

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Carl Banks
On Jul 31, 8:48 pm, Carl Banks wrote: > When you have a class you that don't anything about the implementation > of, that is NOT the place for inheritance. And, just to be clear, if the class is explicity documented as being subclassable and the documentation states the proper procedure for doing

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Carl Banks
On Jul 31, 11:16 am, Ian Kelly wrote: > On Sat, Jul 31, 2010 at 4:22 AM, Steven D'Aprano > > > > wrote: > > On Fri, 30 Jul 2010 21:40:21 -0600, Ian Kelly wrote: > > >> I have to chime in and agree that the name "super" is problematic. I'm > >> reading this thread with a sense of alarm because I a

Docstrings and PEP 3174

2010-07-31 Thread Carl Banks
PEP 3174 got me to thinking. There is now a subdirectory to deposit as many *.pyc files as you want without cluttering the source directory (never mind the default case). Which means you can pretty much write files with impunity. So I was wondering: what about a separate file just for docstrings

python and swig

2010-07-31 Thread Rashad
I have a swig object of type int* (an integer array) how to covert this swig object to python list now : print self.buffer[0] gives swig object of type int* i want to access the elements of array self.buffer[0] like print self.buffer[0][0] , self.buffer[0][1], self.buffer[0][2] etc... -- http:

Re: Why is there no platform independent way of clearing a terminal?

2010-07-31 Thread Lawrence D'Oliveiro
In message , Emile van Sebille wrote: > If all else fails, repeating 24 (or 40,60?) lines feeds clears the > screen cross platform. Depending on the height of the terminal window... -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no platform independent way of clearing a terminal?

2010-07-31 Thread Lawrence D'Oliveiro
In message , Tim Harig wrote: > It would be rewarding as it would make writing cross-platform charactor > mode applications possible. I thought Windows users were allergic to command lines. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no platform independent way of clearing a terminal?

2010-07-31 Thread Lawrence D'Oliveiro
In message , Daniel Fetchinson wrote: > Sure, there are many different terminals and many different operating > systems but in many areas python managed to hide all these complexities > behind a well defined API. Once upon a time, there were indeed many different kinds of actual physical termin

Re: Problem with Elementtree and XMLSchem instance type

2010-07-31 Thread Lawrence D'Oliveiro
In message , Roland Hedberg wrote: > And there is the problem, I've lost the coupling between the prefix > 'fed' and the namespace > "http://docs.oasis-open.org/wsfed/federation/200706";. Why is this a problem? -- http://mail.python.org/mailman/listinfo/python-list

Re: Normalizing A Vector

2010-07-31 Thread Lawrence D'Oliveiro
In message <87sk2zhpcj@dpt-info.u-strasbg.fr>, Alain Ketterlin wrote: > Lawrence D'Oliveiro writes: > >> V = tuple \ >> ( >> x >> / >> l >>for x in V >>for l in >>(math.sqrt(reduce(lambda a, b : a + b, (y * y for y in V),

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Gregory Ewing
Ian Kelly wrote: super(type[, object-or-type]) ... The __mro__ attribute of the type lists the method resolution search order used by both getattr() and super(). The attribute is dynamic and can change whenever the inheritance hierarchy is updated. That explanation does seem to be rather

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Gregory Ewing
Steven D'Aprano wrote: Assuming you accurately tell it the current class, can you give an example where super() doesn't refer to a superclass of the current class? I think we're all confusing each other in this discussion by not being clear enough about what we mean by the "current class". In

HCL Jobs database

2010-07-31 Thread David
If you are looking for Jobs at HCL America Inc. ("HCL Jobs") check out http://2ajobguide.com/hcl_jobs.aspx You´ll get free access to a comprehensive database of HCL jobs and you can apply directly online without intermediates. -- http://mail.python.org/mailman/listinfo/python-list

Re: Call CFUNCTYPE, class Structure, ctype, dll and Callback function problem

2010-07-31 Thread Mark Tolonen
"legard_new" wrote in message news:70faf0b4-fead-49ac-bf18-e182fd63b...@j8g2000yqd.googlegroups.com... Hello, I have a problem with calling Callback function with Python. I have a DLL file. Below is a description in documentation. FUNCTION Callback Arguments: Callback ID integer read-only, i

Re: Normalizing A Vector

2010-07-31 Thread Tim Roberts
Lawrence D'Oliveiro wrote: > >Say a vector V is a tuple of 3 numbers, not all zero. You want to normalize >it (scale all components by the same factor) so its magnitude is 1. > >The usual way is something like this: > >L = math.sqrt(V[0] * V[0] + V[1] * V[1] + V[2] * V[2]) >V = (V[0] / L,

Call CFUNCTYPE, class Structure, ctype, dll and Callback function problem

2010-07-31 Thread legard_new
Hello, I have a problem with calling Callback function with Python. I have a DLL file. Below is a description in documentation. FUNCTION Callback Arguments: Callback ID integer read-only, immediate value CBackProc address read-only, immediate value

Re: Tkinter Label alignment problem using OS 10.6

2010-07-31 Thread AJ
On Jul 31, 8:04 am, r wrote: > On Jul 31, 2:55 am, Peter Otten <__pete...@web.de> wrote: > > > PS: Rantingrick is right; you should use one of the other geometry managers > > Incidentally I was actually writing a version of the OP's script using > the grid manager when i found his nasty response.

Re: Tkinter Label alignment problem using OS 10.6

2010-07-31 Thread AJ
On Jul 31, 12:55 am, Peter Otten <__pete...@web.de> wrote: > AJ wrote: > > I have written a sample program that ran correctly with earlier than > > Mac OS 10.6. The answer field Label does not align correctly. I > > downloaded the latest Python 2.7 release but still did not solve the > > problem.  

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Ian Kelly
On Sat, Jul 31, 2010 at 4:22 AM, Steven D'Aprano wrote: > On Fri, 30 Jul 2010 21:40:21 -0600, Ian Kelly wrote: > >> I have to chime in and agree that the name "super" is problematic. I'm >> reading this thread with a sense of alarm because I apparently never >> read the super() documentation too c

Re: Newbie question regarding SSL and certificate verification

2010-07-31 Thread Heikki Toivonen
Jeffrey Gaynor wrote: > A final question -- how widely is M2Crypto used? Since I will have to now > pitch >to our group that this is preferable the first questions they will ask are about >stability, who is using it and how secure is it really, especially since it is >at version 0.20.2 (i.e. no m

Re: default behavior

2010-07-31 Thread Christian Heimes
> The truth, as Christian says above and as Raymond Hettinger recently > pointed out [1], is that __missing__ is used to *define* defaultdict as > a subclass of dict -- it's not used *by* defaultdict. Your answer is confusing even me. ;) Let me try an easier to understand explanation. defaultdi

Re: default behavior

2010-07-31 Thread John Posner
On 7/31/2010 11:08 AM, Christian Heimes wrote: ... All you have to do is subclass dict and implement a __missing__ method. See http://docs.python.org/library/stdtypes.html?highlight=__missing__#mapping-types-dict Caveat -- there's another description of defaultdict here: http://docs.python.

International IT Consultant Jobs from 14 Countries

2010-07-31 Thread Bolaleman
Looking for IT consultant jobs? Maybe you find your new job in the USA, Canada, Australia, India or in Europe using this IT consultant job database: http://2ajobguide.com/consulting_IT_job_database.aspx This service is free and you can apply directly without intermediates. -- http://mail.python.

Re: default behavior

2010-07-31 Thread Christian Heimes
Am 30.07.2010 14:34, schrieb wheres pythonmonks: > I was hoping not to do that -- e.g., actually reuse the same > underlying data. Maybe dict(x), where x is a defaultdict is smart? I > agree that a defaultdict is safe to pass to most routines, but I guess > I could imagine that a try/except block

Re: Tkinter Label alignment problem using OS 10.6

2010-07-31 Thread r
On Jul 31, 2:55 am, Peter Otten <__pete...@web.de> wrote: > PS: Rantingrick is right; you should use one of the other geometry managers Incidentally I was actually writing a version of the OP's script using the grid manager when i found his nasty response. So I think i'll just keep it for me self

Re: default behavior

2010-07-31 Thread wheres pythonmonks
I think of an upcast as casting to the base-class (casting up the inheritance tree). http://en.wiktionary.org/wiki/upcast But really, what I am thinking of doing is overriding the virtual methods of a derived class with the base class behavior in an object that I can then pass into methods that are

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Brian Victor
Steven D'Aprano wrote: > On Sat, 31 Jul 2010 14:25:39 +1200, Gregory Ewing wrote: > >> Steven D'Aprano wrote: >> >>> A >>> / \ >>> C B >>> \ / >>> D >>> / \ >>> E F >>> >>> Yes, a super call might jog left from C to B, but only when being >>> called from one

Re: Normalizing A Vector

2010-07-31 Thread Alain Ketterlin
Lawrence D'Oliveiro writes: >>> What I don’t like is having that intermediate variable L leftover after >>> the computation. >> >> Well, it also guarantees that the square root is computed once. > > OK, this version should solve that problem, without requiring any new > language features: > >

Re: Normalizing A Vector

2010-07-31 Thread Thomas Jollans
On 07/31/2010 12:15 PM, Lawrence D'Oliveiro wrote: >reduce(lambda a, b : a + b, (y * y for y in V), 0)) > This is a lot more verbose than it has to be, and probably slower too. firstly: (lambda a,b: a+b) is equivalent to operator.add. ==> reduce(operator.add, (y*y for y in V), 0) However - re

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Steven D'Aprano
On Fri, 30 Jul 2010 21:40:21 -0600, Ian Kelly wrote: > I have to chime in and agree that the name "super" is problematic. I'm > reading this thread with a sense of alarm because I apparently never > read the super() documentation too closely (why would I? "Oh, it just > accesses an attribute from

Re: Normalizing A Vector

2010-07-31 Thread Lawrence D'Oliveiro
In message <877hkdhyl5@dpt-info.u-strasbg.fr>, Alain Ketterlin wrote: > Lawrence D'Oliveiro writes: > >> What I don’t like is having that intermediate variable L leftover after >> the computation. > > Well, it also guarantees that the square root is computed once. OK, this version should s

Get perl method documentation in python wrapper

2010-07-31 Thread srinivasan munisamy
Hi, I would like to get the documentation of a perl method inside python wrapper. To say it with example, there is a perl module ‘X.pm’. It has a method ‘print_hello()’. x.py is a wrapper module over X.pm. when I say x.print_hello.__doc__ then I need to get the documentation of X::print_hello. Th

Re: default behavior

2010-07-31 Thread Steven D'Aprano
On Sat, 31 Jul 2010 01:02:47 -0400, wheres pythonmonks wrote: >> Hint -- what does [].append(1) return? >> >> > Again, apologies from a Python beginner. It sure seems like one has to > do gymnastics to get good behavior out of the core-python: > > Here's my proposed fix: > > m['key'] = (lambd

"SEXY THAI GIRLS" "SEXY CHINESE GIRLS" "SEXY BOLLYWOOD GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY JAPANESE GIRLS" "SEXY VIETNAM GIRLS" "SEXY HONG KONG GIRLS" "SEXY INDIAN GIRLS" "SEXY PAKISTANI GIRLS" ON ht

2010-07-31 Thread SIRAJ ANSARI
"SEXY THAI GIRLS" "SEXY CHINESE GIRLS" "SEXY BOLLYWOOD GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY JAPANESE GIRLS" "SEXY VIETNAM GIRLS" "SEXY HONG KONG GIRLS" "SEXY INDIAN GIRLS" "SEXY PAKISTANI GIRLS" ON http://6ygirls4u.blogspot.com/ "SEXY THAI GIRLS" "SEXY CHINESE GIRLS" "SEXY BOLLYWOOD

Re: pylint scores

2010-07-31 Thread Matteo Landi
What are the messages one should really care about while evaluating its code using pylint? It's easy to get 5 scored with a "lot of public methods" or bad named variables such as 'x' or 'y' .. Have you got any config file to share? On Sat, Jul 31, 2010 at 2:48 AM, Dan Stromberg wrote: > > On Fri,

Re: Tkinter Label alignment problem using OS 10.6

2010-07-31 Thread Peter Otten
AJ wrote: > I have written a sample program that ran correctly with earlier than > Mac OS 10.6. The answer field Label does not align correctly. I > downloaded the latest Python 2.7 release but still did not solve the > problem. Look for line "L4.place(relx=0.32,rely=0.56, anchor=W)" The underly

Re: Tkinter Label alignment problem using OS 10.6

2010-07-31 Thread Mark Young
That seems a bit harsh. Place, in general, isn't as useful as pack and grid. Yelling at him for suggesting you use them is unnecessary. When I looked at when your script generates, I don't see why you couldn't just use grid. I can fairly easily see a grid layout. But, I guess it's supposed to be a

Re: Normalizing A Vector

2010-07-31 Thread John Nagle
On 7/30/2010 6:46 AM, Alain Ketterlin wrote: Does the compiler hoist the math.sqrt(...) out of the implicit loop? Global optimization in Python? Not in CPython. The program might redefine math.sqrt from another thread while the program is running, which would invalidate the hoisting of