Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread harrismh777
Terry Reedy wrote: Python 3 was announced and as a mildly code breaking version at least 5 years before it came out. I appreciate the spirit of your arguments overall, and I do not necessarily disagree with much of what you are saying. I would like to challenge you to see this from a litt

Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread Chris Angelico
On Fri, Apr 1, 2011 at 5:13 PM, harrismh777 wrote: >    Corollary 1)a The Class interface never encapsulates cruft. Provably false. Even a well-designed interface, if it is asked to deal with a changing implementation and changing requirements, will eventually either acquire cruft, or be found to

Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread harrismh777
Steven D'Aprano wrote: The difference between implementation and interface is not specific to object-oriented code -- When I speak of implementation vs interface I am speaking from a strictly object oriented philosophy, as pedigree, from Grady Booch, whom I consider to be the father of Ob

Re: Behaviour of subprocess.Popen, ssh and nohup I don't understand

2011-03-31 Thread Kushal Kumaran
On Fri, Apr 1, 2011 at 4:31 AM, Adriaan Renting wrote: > L.S. > > I have a problem that a background process that I'm trying to start with > subprocess.Popen gets interrupted and starts waiting for input no matter > what I try to do to have it continue to run. It happens when I run it > with nohup

Re: Extracting subsequences composed of the same character

2011-03-31 Thread Terry Reedy
On 3/31/2011 10:20 PM, Tim Chase wrote: On 03/31/2011 07:43 PM, candide wrote: "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' Or, if you want to do it with itertools instead of the "re" modul

Re: FBI wants public help solving encrypted notes from murder mystery

2011-03-31 Thread haha doh
On Mar 31, 3:15 pm, Joe Snodgrass wrote: > On Mar 30, 10:18 pm, "Stretto" wrote: > > > > > > > "Joe Snodgrass" wrote in message > > >news:c37e8e0b-a825-4ac5-9886-8828ab1fa...@x8g2000prh.googlegroups.com... > > > > FBI cryptanalysis hasn’t decrypted notes from 1999 murder mystery > > > >http://ti

Re: Alias for an attribute defined in a superclass

2011-03-31 Thread Raymond Hettinger
On Mar 31, 3:14 pm, Ben Finney wrote: > Howdy all, > > I want to inherit from a class, and define aliases for many of its > attributes. How can I refer to “the attribute that will be available by > name ‘spam’ once this class is defined”? > >     class Foo(object): >         def spam(self): >    

Re: Extracting subsequences composed of the same character

2011-03-31 Thread Tim Chase
On 03/31/2011 07:43 PM, candide wrote: "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' Or, if you want to do it with itertools instead of the "re" module: >>> s = "pyyythhooonnn ---> " >>

Re: Extracting subsequences composed of the same character

2011-03-31 Thread Tim Chase
On 03/31/2011 07:43 PM, candide wrote: Suppose you have a string, for instance "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' >>> import re >>> s = "pyyythhooonnn ---> " >>> [m.group(0)

A problem about ipython

2011-03-31 Thread Vincent Ren
Hey, everyone, I'm trying to use ipython recently. It's very nice, however, when I run this(from Programming Python 3rd) in ipython, I'll get a NameError: In [1]: import settime, timer, set In [2]: import profile In [3]: profile.run('timer.test(100, settime.setops, set.Set)') --

Re: Extracting subsequences composed of the same character

2011-03-31 Thread Roy Smith
In article <4d952008$0$3943$426a7...@news.free.fr>, candide wrote: > Suppose you have a string, for instance > > "pyyythhooonnn ---> " > > and you search for the subquences composed of the same character, here > you get : > > 'yyy', 'hh', 'ooo', 'nnn', '---', '' I got the following.

Re: a basic bytecode to machine code compiler

2011-03-31 Thread Dan Stromberg
On Thu, Mar 31, 2011 at 5:52 PM, Terry Reedy wrote: > On 3/31/2011 6:33 PM, Rouslan Korneychuk wrote: > >> I was looking at the list of bytecode instructions that Python uses and >> I noticed how much it looked like assembly. So I figured it can't be to >> hard to convert this to actual machine c

Re: Extracting subsequences composed of the same character

2011-03-31 Thread MRAB
On 01/04/2011 01:43, candide wrote: Suppose you have a string, for instance "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' It's not difficult to write a Python code that solves the problem, fo

Re: Alias for an attribute defined in a superclass

2011-03-31 Thread Ben Finney
Steven D'Aprano writes: > On Fri, 01 Apr 2011 09:14:03 +1100, Ben Finney wrote: > > > I want to inherit from a class, and define aliases for many of its > > attributes. > > Are these aliases of arbitrary aliases, or only of methods, as in your > example below? I'd like to know how to do either,

Re: Alias for an attribute defined in a superclass

2011-03-31 Thread Ben Finney
Calvin Spealman writes: > Sounds like you're just going to end up with more confusing code > having multiple ways to refer to the exact same thing. Why? (Why did you top-post?) I'm defining aliases to conform to an existing API. The “Foo” class's attributes are what is needed, but not by the ri

Re: a basic bytecode to machine code compiler

2011-03-31 Thread Terry Reedy
On 3/31/2011 6:33 PM, Rouslan Korneychuk wrote: I was looking at the list of bytecode instructions that Python uses and I noticed how much it looked like assembly. So I figured it can't be to hard to convert this to actual machine code, to get at least a small boost in speed. And so I whipped up

Extracting subsequences composed of the same character

2011-03-31 Thread candide
Suppose you have a string, for instance "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' It's not difficult to write a Python code that solves the problem, for instance : def f(text): ch

Re: Alias for an attribute defined in a superclass

2011-03-31 Thread Calvin Spealman
Sounds like you're just going to end up with more confusing code having multiple ways to refer to the exact same thing. Why? On Thu, Mar 31, 2011 at 6:14 PM, Ben Finney wrote: > Howdy all, > > I want to inherit from a class, and define aliases for many of its > attributes. How can I refer to “the

Re: Alias for an attribute defined in a superclass

2011-03-31 Thread Steven D'Aprano
On Fri, 01 Apr 2011 09:14:03 +1100, Ben Finney wrote: > Howdy all, > > I want to inherit from a class, and define aliases for many of its > attributes. Are these aliases of arbitrary aliases, or only of methods, as in your example below? > How can I refer to “the attribute that will be avail

Re: In List Query -> None Case Sensitive?

2011-03-31 Thread MRAB
On 31/03/2011 23:05, Ethan Furman wrote: Wehe, Marco wrote: I am doing a search through a list of files but the text the casing doesn't match. My list is all upper case but the real files are all different. Is there a smooth way of searching through the list without going full on regular express

Re: a basic bytecode to machine code compiler

2011-03-31 Thread Stefan Behnel
Rouslan Korneychuk, 01.04.2011 00:33: I was looking at the list of bytecode instructions that Python uses and I noticed how much it looked like assembly. So I figured it can't be to hard to convert this to actual machine code, to get at least a small boost in speed. I think I recall having read

Re: In List Query -> None Case Sensitive?

2011-03-31 Thread Chris Angelico
On Fri, Apr 1, 2011 at 10:42 AM, Steven D'Aprano wrote: > (Oh, and I don't want to come across as elitist, but if you're using the > two-ton wrecking ball of Microsoft Word to crack the tiny peanut of > writing emails, you will have *zero* tech credibility in programming > communities. Harsh but t

Re: cx_Freeze 4.2.3

2011-03-31 Thread James Mills
On Sun, Mar 20, 2011 at 9:52 AM, Anthony Tuininga wrote: > Where do I get it? > > http://cx-freeze.sourceforge.net Just as a matter of interest, I tried to install cx_Freeze with pip/distribute (Python 2.7.1) but it fails with: error: option --single-version-externally-managed not recognized ch

Re: In List Query -> None Case Sensitive?

2011-03-31 Thread Steven D'Aprano
On Thu, 31 Mar 2011 21:14:45 +, Wehe, Marco wrote: [...] Hi Marco, and welcome. Others have already answered your question, but please don't post HTML formatted messages (so-called "rich text") to this mailing list. It is mirrored to a newsgroup, comp.lang.python, and many people read it vi

Re: py 2.7.1 & openssl

2011-03-31 Thread V N
Yes, _md5 is enabled but I get a very long list under Failed to build these modules: _bisect_codecs_cn _codecs_hk _codecs_iso2022_codecs_jp _codecs_kr _codecs_tw _collections _csv _ctypes_ctypes_test _curses _curses_panel _elemen

Behaviour of subprocess.Popen, ssh and nohup I don't understand

2011-03-31 Thread Adriaan Renting
L.S. I have a problem that a background process that I'm trying to start with subprocess.Popen gets interrupted and starts waiting for input no matter what I try to do to have it continue to run. It happens when I run it with nohup in the background. I've tried to find a solution searching the int

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread John Bokma
Chris Angelico writes: > On Fri, Apr 1, 2011 at 8:57 AM, geremy condra wrote: >> I know it's tongue-in-cheek, but please, please, please don't do this. > > It would be more secure to base64 it and then rot13 the output. Rot-13 twice, to make it even more secure ;-) -- John Bokma

Re: py 2.7.1 & openssl

2011-03-31 Thread nirinA
[V N] import _md5 ImportError: No module named _md5 Any idea(s)? try to build Python with pydebug to enable _md5: ./configure --with-pydebug nirinA -- http://mail.python.org/mailman/listinfo/python-list

a basic bytecode to machine code compiler

2011-03-31 Thread Rouslan Korneychuk
I was looking at the list of bytecode instructions that Python uses and I noticed how much it looked like assembly. So I figured it can't be to hard to convert this to actual machine code, to get at least a small boost in speed. And so I whipped up a proof of concept, available at https://git

ANN: Wing IDE 4.0.1 released

2011-03-31 Thread Wingware
Hi, Wingware has released version 4.0.1 of Wing IDE, an integrated development environment designed specifically for the Python programming language. Wing IDE is a cross-platform Python IDE that provides a professional code editor with vi, emacs, and other key bindings, auto-completion, call tip

Alias for an attribute defined in a superclass

2011-03-31 Thread Ben Finney
Howdy all, I want to inherit from a class, and define aliases for many of its attributes. How can I refer to “the attribute that will be available by name ‘spam’ once this class is defined”? class Foo(object): def spam(self): pass def eggs(self): pass

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread Chris Angelico
On Fri, Apr 1, 2011 at 8:57 AM, geremy condra wrote: > I know it's tongue-in-cheek, but please, please, please don't do this. It would be more secure to base64 it and then rot13 the output. Chris Angelico /me is feeling evil today === Begin Base-Rotten 64-13 === FKDtq291oTDtLzHtoJ9lMFOmMJA1pzHt

Re: logging module usage

2011-03-31 Thread Vinay Sajip
On Mar 30, 3:49 pm, mennis wrote: > I am working on a library for controlling various appliances in which > I use theloggingmodule.  I'd like some input on the basic structure > of what I've done.  Specifically theloggingaspect but more general > comments are welcome.  I'm convinced I mis-understa

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread geremy condra
On Thu, Mar 31, 2011 at 2:43 PM, eryksun () wrote: > On Thursday, March 31, 2011 4:35:42 PM UTC-4, Chris Angelico wrote: >> >> I was trolling, I know the reasons behind it. Anyway, most people >> don't share code by email! (Actually, since you seem to be the author >> of that page - could you addr

Re: In List Query -> None Case Sensitive?

2011-03-31 Thread Ethan Furman
Wehe, Marco wrote: I am doing a search through a list of files but the text the casing doesn't match. My list is all upper case but the real files are all different. Is there a smooth way of searching through the list without going full on regular expressions? path = "V:\\Jinsy\\incoming\\ass

Re: In List Query -> None Case Sensitive?

2011-03-31 Thread Ian Kelly
On Thu, Mar 31, 2011 at 3:14 PM, Wehe, Marco wrote: > Hi, > > > > I am doing a search through a list of files but the text the casing doesn't > match. My list is all upper case but the real files are all different. Is > there a smooth way of searching through the list without going full on > reg

Re: In List Query -> None Case Sensitive?

2011-03-31 Thread Chris Angelico
On Fri, Apr 1, 2011 at 8:14 AM, Wehe, Marco wrote: > > I am doing a search through a list of files but the text the casing doesn't > match. My list is all upper case but the real files are all different. Is > there a smooth way of searching through the list without going full on > regular expre

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread eryksun ()
On Thursday, March 31, 2011 4:35:42 PM UTC-4, Chris Angelico wrote: > > I was trolling, I know the reasons behind it. Anyway, most people > don't share code by email! (Actually, since you seem to be the author > of that page - could you address that particular point? I think it's > probably as big

In List Query -> None Case Sensitive?

2011-03-31 Thread Wehe, Marco
Hi, I am doing a search through a list of files but the text the casing doesn't match. My list is all upper case but the real files are all different. Is there a smooth way of searching through the list without going full on regular expressions? path = "V:\\Jinsy\\incoming\\assets" media=["LI

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread Dan Stromberg
On Thu, Mar 31, 2011 at 1:35 PM, Chris Angelico wrote: > On Fri, Apr 1, 2011 at 4:54 AM, Dan Stromberg wrote: > > > > http://stromberg.dnsalias.org/~strombrg/significant-whitespace.html > > > > I was trolling, I know the reasons behind it. Anyway, most people > don't share code by email! (Actual

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread Chris Angelico
On Fri, Apr 1, 2011 at 4:54 AM, Dan Stromberg wrote: > > http://stromberg.dnsalias.org/~strombrg/significant-whitespace.html > I was trolling, I know the reasons behind it. Anyway, most people don't share code by email! (Actually, since you seem to be the author of that page - could you address t

Re: multiprocessing Pool.imap broken?

2011-03-31 Thread eryksun ()
For comparison, here's the debug info on Win32 Python 2.71. Multiprocessing on Windows seems like a very different beast (e.g. there's no way to fork). Case 1: In [1]: %cpaste Pasting code; enter '--' alone on the line to stop. :import multiprocessing as mp :import multiprocessing.util as util :

Re: call php function from python

2011-03-31 Thread John Bokma
CrabbyPete writes: > I have a python script that automatically loads wordpress, up to the > point that it asks for the admin password. > that is a php function call > > function wp_install( $blog_title, $user_name, $user_email, $public, > $deprecated = '', $user_password = '' ) > > Is there a way

Re: FBI wants public help solving encrypted notes from murder mystery

2011-03-31 Thread Joe Snodgrass
On Mar 30, 10:18 pm, "Stretto" wrote: > "Joe Snodgrass" wrote in message > > news:c37e8e0b-a825-4ac5-9886-8828ab1fa...@x8g2000prh.googlegroups.com... > > > > > > > FBI cryptanalysis hasn’t decrypted notes from 1999 murder mystery > > >http://tinyurl.com/4d56zsz > > > The FBI is seeking the public

call php function from python

2011-03-31 Thread CrabbyPete
I have a python script that automatically loads wordpress, up to the point that it asks for the admin password. that is a php function call function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' ) Is there a way to call this function from python?

Re: multiprocessing Pool.imap broken?

2011-03-31 Thread Yang Zhang
My self-reply tried to preempt your suggestion :) On Wed, Mar 30, 2011 at 12:12 AM, kyle.j.con...@gmail.com wrote: > Yang, > > My guess is that you are running into a problem using multiprocessing with > the interpreter. The documentation states that Pool may not work correctly > in this case. >>

Re: multiprocessing Pool.imap broken?

2011-03-31 Thread Yang Zhang
The problem was that Pool shuts down from its finalizer: http://stackoverflow.com/questions/5481104/multiprocessing-pool-imap-broken/5481610#5481610 On Wed, Mar 30, 2011 at 5:59 AM, eryksun () wrote: > On Tuesday, March 29, 2011 9:44:21 PM UTC-4, Yang Zhang wrote: >> I've tried both the multipro

Corrections... :/

2011-03-31 Thread wisecracker
Sorry but I typed that loy in manually so:- # Linux... if sys.platform == "linux2": # myportnumber = raw_input(.. should read:- myportnumber = raw_input(.. # Similarly for Windows... if sys.platform == "win32": # myportnumber = raw_input( should also

Re: Get USB ID of a serial port through pyserial?

2011-03-31 Thread wisecracker
Hi John Nagle... > Is there some way to get the USB ID of a serial port through pyserial on > Linux and/or > Windows? I`m surprised that the big guns on here haven`t helped... Short answer no. > USB serial port devices have device names determined by when they were > plugged in. Yep and they

Re: py 2.7.1 & openssl

2011-03-31 Thread V N
Thank you for your response. Here's some more information: RHEL 5.3 / x86_64, using gcc I am now compiling openssl-1.0.0d using: ./config --prefix=/usr/local --openssldir=/usr/local/openssl -fPIC shared threads zlib I do have the logs for config, make and make install. There are no errors in

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread Dan Stromberg
On Thu, Mar 31, 2011 at 9:18 AM, Chris Angelico wrote: > On Fri, Apr 1, 2011 at 3:12 AM, eryksun () wrote: > > There appears to be a formatting error here. > > So remind me again why Python likes whitespace to be significant? > > > http://stromberg.dnsalias.org/~strombrg/significant-whitespace

python 2.6 script for Ubuntu Enterprise Cloud

2011-03-31 Thread shrek
Greetings I am having some problems with one of the scripts below. I wonder if anyone has run into a similar issue or knows a fix? Seems I need to configure the proxy for python. I did it in image- store-proxy file in /var/log. Is that the right place? -- http://mail.python.org/mailman/listin

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread Chris Angelico
On Fri, Apr 1, 2011 at 3:12 AM, eryksun () wrote: > There appears to be a formatting error here. So remind me again why Python likes whitespace to be significant? :) Chris Angelico PS. Yes, I know "remind me again" is redundant. You have to make mistakes when you troll, it's a moral imperativ

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread eryksun ()
On Wednesday, March 30, 2011 11:03:09 PM UTC-4, JosephS wrote: > print "How old are you?", age = raw_input() > print "How tall are you?", height = raw_input() > print "How much do you weigh?", weight = raw_input() > print "So, you're %r old, %r tall and %r heavy." % ( age, height, > weight) > Note:

Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread Terry Reedy
On 3/31/2011 2:34 AM, harrismh777 wrote: breaking a fundamental law of object oriented programming... don't break and advertised interface (particularly if it is useful and people are actually making use of it!). This is insane folks. Each x.y version (starting with 2.3) is feature stable: jus

Re: Get USB ID of a serial port through pyserial?

2011-03-31 Thread Tim Golden
On 30/03/2011 20:01, John Nagle wrote: Is there some way to get the USB ID of a serial port through pyserial on Linux and/or Windows? USB serial port devices have device names determined by when they were plugged in. So, if you have more than one USB serial device, you need the USB device's built

Re: running Python2 Python3 parallel concurrent

2011-03-31 Thread John Roth
On Mar 30, 7:05 pm, harrismh777 wrote: > Greetings, > >      The purpose of this communique is to document a process for > installing python2.7.1 in parallel with python3.2 on a concurrent > desktop with independent idle and python path structure. > > ... > >      Kind regards, > >      m harris >

EuroPython 2011: call for paper is ending - Please spread the word!

2011-03-31 Thread Palla
Hi all members, I'm Francesco and I am writing on behalf of "Python Italia APS", a no-profit association promoting EuroPython conference. (www.europython.eu) Europython End of Call for Presentations is April 6th. I'd like to ask to you to forward this mail to anyone that you feel may be interested

EuroPython 2011: call for paper is ending - Please spread the word!

2011-03-31 Thread Palla
Hi all members, I'm Francesco and I am writing on behalf of "Python Italia APS", a no- profit association promoting EuroPython conference. (www.europython.eu) Europython end of Call for Presentations is April 6th. I'd like to ask to you to forward this mail to anyone that you feel may be intereste

Re: argparse csv + choices

2011-03-31 Thread Neal Becker
Robert Kern wrote: > On 3/30/11 10:32 AM, Neal Becker wrote: >> I'm trying to combine 'choices' with a comma-seperated list of options, so I >> could do e.g., >> >> --cheat=a,b >> >> parser.add_argument ('--cheat', choices=('a','b','c'), type=lambda x: >> x.split(','), default=[]) >> >> test.

Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread Paul Rubin
Antoon Pardon writes: > Something else the dev team can consider, is a Negation class > This would have to be done by the dev team since I > guess that writing such a thing in Python would loose all the speed > of using a key-function. That is a good idea. SQL has something like it, I think,

Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread Antoon Pardon
On Thu, Mar 31, 2011 at 02:13:53AM +, Steven D'Aprano wrote: > On Wed, 30 Mar 2011 11:06:20 +0200, Antoon Pardon wrote: > > > As far as I can see, key will only produce significant speedups, if > > comparing items can then be completly done internally in the python > > engine without referenci

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread Steven D'Aprano
On Wed, 30 Mar 2011 20:03:09 -0700, Joseph Sanoyo wrote: > print "How old are you?", age = raw_input() print "How tall are you?", > height = raw_input() print "How much do you weigh?", weight = > raw_input() print "So, you're %r old, %r tall and %r heavy." % ( age, > height, weight) > Note: > Noti

Re: Guido rethinking removal of cmp from sort method

2011-03-31 Thread Steven D'Aprano
On Thu, 31 Mar 2011 01:34:17 -0500, harrismh777 wrote: > Many of you (Guido included) have lost significant sight of a > critical object oriented philosophical pillar (but not all of you, thank > goodness). To cut right to the heart of it--- NEVER change an advertised > interface. Thanks fo

Re:py 2.7.1 & openssl

2011-03-31 Thread nirinA raseliarison
[V N] > I installed openssl-1.0.0d.tar.gz on my RHEL 5 box using: > ./config --prefix=/usr/local --openssldir=/usr/local/openssl > shared zlib you need to compile openssl with -fPIC flags, depending on your system and compiler: ./config linux-generic:gcc -fPIC shared and then recompile Python.