Re: How to order base classes?

2010-12-23 Thread Tim Roberts
kj wrote: > >Suppose that I want to write a subclass C of base classes A and B. >What considerations should go into choosing the ordering of A and >B in C's base class list? >... >...it is difficult for me to see a strong compelling reason for picking >an ordering over another. But may be just ig

Re: What is the the best style and theory of writing a complier in your language

2010-12-23 Thread Juha Nieminen
In comp.lang.c++ small Pox wrote: > http://www.veteranstoday.com/2010/12/18/gordon-duff-gov-jesse-ventura-proves-911-cover-up-will-americas-government-fall/ You should take your religion somewhere else. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pop the interpreter's stack?

2010-12-23 Thread Carl Banks
On Dec 23, 8:55 pm, Steven D'Aprano wrote: > On Thu, 23 Dec 2010 02:54:52 -0800, Carl Banks wrote: > > On Dec 22, 7:22 pm, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: > >> There should be a mechanism for Python functions to distinguish between > >> unexpected exceptions (commonly kn

Re: Partition Recursive

2010-12-23 Thread Ian Kelly
On 12/23/2010 10:03 PM, kj wrote: import re # sorry sp = re.compile('(//?|[;?:@=&#.])') filter(len, sp.split(url)) Perhaps I'm being overly pedantic, but I would likely have written that as "filter(None, sp.split(url))" for the same reason that "if string:" is generally preferred to "if len(s

Re: Partition Recursive

2010-12-23 Thread kj
In macm writes: >url = >'http://docs.python.org/dev/library/stdtypes.html?highlight=partition#str.partition' >So I want convert to >myList = >['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partit

Re: How to pop the interpreter's stack?

2010-12-23 Thread Steven D'Aprano
On Thu, 23 Dec 2010 02:54:52 -0800, Carl Banks wrote: > On Dec 22, 7:22 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> There should be a mechanism for Python functions to distinguish between >> unexpected exceptions (commonly known as "bugs"), which should be >> reported as coming

Re: How to order base classes?

2010-12-23 Thread kj
In <4d14209d$0$3$c3e8da3$54964...@news.astraweb.com> Steven D'Aprano writes: >The question you ask can only be answered in reference to a specific >class with specific methods. There is no general principle, it depends >entirely on the problem being solved. Thanks! ~kj -- http://mail.py

Re: How to order base classes?

2010-12-23 Thread Steven D'Aprano
On Fri, 24 Dec 2010 03:36:28 +, kj wrote: > How should one go about deciding the ordering of base classes? There is no general way for doing so. You need to consider the actual functionality of the methods involved. Consider a method spam() of class C that inherits from both A and B. To be

How to order base classes?

2010-12-23 Thread kj
Suppose that I want to write a subclass C of base classes A and B. What considerations should go into choosing the ordering of A and B in C's base class list? Since any order one chooses can be overridden on a per-method basis, by assigning the desired parent's method to the appropriate class a

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Benedict Verheyen
On 24/12/2010 2:16, Benedict Verheyen wrote: > On 23/12/2010 20:55, Stefan Sonnenberg-Carstens wrote: >>> I finally succeeded. I built ncurses and installed it to $HOME/usr/local ./configure --with-shared --enable-termcap --prefix=$HOME/usr/local make make install Then i built readline ./configu

GUI Tools for Python 3.1

2010-12-23 Thread Randy Given
Lots of stuff for 2.6 and 2.7 -- what GUI tools are there for 3.1? Randy -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Benedict Verheyen
On 23/12/2010 20:55, Stefan Sonnenberg-Carstens wrote: >> >> > OK, I compiled it successfully under Debian 5.07 i386. > ncurses and libreadline are compiled from hand, both --prefix=$HOME/usr/local. > For python the only extra needed was export > LD_LIBRARY_PATH=$HOME/usr/local/lib:$LD_LIBRARY_PA

David Epstein Incest Charges: Columbia Professor Charged With Sleeping With Daughter

2010-12-23 Thread small Pox
On Dec 23, 2:01 pm, small Pox wrote: > What is the the best style and theory of writing a complier in your > language > > Maybe a book will suffice. > > http://www.veteranstoday.com/2010/12/18/gordon-duff-gov-jesse-ventura... > > I want to parse the contents of the above link into hebrew audio. >

Re: Partition Recursive

2010-12-23 Thread Rhodri James
Please don't top-post, it makes everything harder to read. (Re-ordering to make sense...) On Thu, 23 Dec 2010 18:05:39 -, macm wrote: On Dec 23, 3:57 pm, Jon Clements wrote: I would use urlparse.urlsplit, then split further, if required. >>> urlsplit(url) SplitResult(scheme='http', n

Re: class inheritance

2010-12-23 Thread JLundell
That's nice, Ethan, especially in that it saves having to explicitly find and list all the methods being covered. It's perhaps not quite so critical for a Fraction-based class, since the set of methods to be covered is fairly well contained, but that's not always going to be the case. The appro

Re: Catching user switching and getting current active user from root on linux

2010-12-23 Thread mpnordland
Ok, thank you. I will go look at the resources mentioned. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression for "key = value" pairs

2010-12-23 Thread Ciccio
I extracted an isolated problem from a slightly more complex situation, that's why I'm using REs. Thank you all for your help, my problem is now solved. -- http://mail.python.org/mailman/listinfo/python-list

What is the the best style and theory of writing a complier in your language

2010-12-23 Thread small Pox
What is the the best style and theory of writing a complier in your language Maybe a book will suffice. http://www.veteranstoday.com/2010/12/18/gordon-duff-gov-jesse-ventura-proves-911-cover-up-will-americas-government-fall/ I want to parse the contents of the above link into hebrew audio. CHEE

Re: using python ftp

2010-12-23 Thread Matt Funk
Hi, thanks for the response. I kind of was thinking along those lines. The thing is though is that 'grop' appears to work on the local directory only (and not on the remote one which i need) Anyway, i think i'll just do via iterating through a the remote directory listing and then match it via reg

Re: Trying to parse a HUGE(1gb) xml file

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 21:27, schrieb Nobody: On Wed, 22 Dec 2010 23:54:34 +0100, Stefan Sonnenberg-Carstens wrote: Normally (what is normal, anyway?) such files are auto-generated, and are something that has a apparent similarity with a database query result, encapsuled in xml. Most of the time the str

Re: round in 2.6 and 2.7

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 19:57, schrieb Hrvoje Niksic: I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. 9.95 9.9493 "%.16g" % 9.95 '9.949' round(9.95,

Re: Generator question

2010-12-23 Thread Nobody
On Wed, 22 Dec 2010 15:49:31 -0800, Dan Stromberg wrote: > def generator(): > i = 0 > while True: > yield i > i += 1 Shorter version: from itertools import count as generator -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to parse a HUGE(1gb) xml file

2010-12-23 Thread Nobody
On Wed, 22 Dec 2010 23:54:34 +0100, Stefan Sonnenberg-Carstens wrote: > Normally (what is normal, anyway?) such files are auto-generated, > and are something that has a apparent similarity with a database query > result, encapsuled in xml. > Most of the time the structure is same for every "row"

daml 0.1.4 released, a python markup language for the web

2010-12-23 Thread dasacc22
Notes on the latest updates can be read here: http://dasacc22.wordpress.com/2010/12/22/daml-0-1-4-release/ The source is on github: https://github.com/dasacc22/daml An sdist is available on pypi: http://pypi.python.org/pypi/DAML/0.1.4 daml is for outlining html with dynamic content. Features inlin

Re: round in 2.6 and 2.7

2010-12-23 Thread Martin v. Loewis
> Type "help", "copyright", "credits" or "license" for more information. 9.95 > 9.9493 "%.16g" % 9.95 > '9.949' round(9.95, 1) > 10.0 > > So it seems that Python is going out of its way to intuitively round > 9.95, while the repr retains the unnecessary digit

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 15:37, schrieb Benedict Verheyen: On 23/12/2010 14:09, Benedict Verheyen wrote: I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python

Re: general problem when subclassing a built-in class

2010-12-23 Thread bill
In kj writes: >Where in the Python documentation can one find the information >required to determine the minimal[1] set of methods that one would >need to override to achieve this goal? > I don't know the answer to that question, but imho it's the wrong question to ask. Instead you should b

Re: round in 2.6 and 2.7

2010-12-23 Thread macm
On Dec 23, 4:57 pm, Hrvoje Niksic wrote: > I stumbled upon this.  Python 2.6: > > Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> 9.95 > 9.9493 > >>> "%.16g" % 9.95 > '9.949

Re: Python Web App

2010-12-23 Thread Tim Harig
On 2010-12-23, Daniel Fetchinson wrote: >> I don't personally think the web makes a good framework for highly >> interactive applications as they must work within the constraints of the >> browser and IDEs are highly interactive applications by their very nature. >> Perhaps HTML5/CSS3 will change

round in 2.6 and 2.7

2010-12-23 Thread Hrvoje Niksic
I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 9.95 9.9493 >>> "%.16g" % 9.95 '9.949' >>> round(9.95, 1) 10.0 So it seems that Python is go

installing scikits.timeseries

2010-12-23 Thread Tintifax
I tried to install scikits.timeseries via "easy_install" and received following Error Message: Found executable C:\MinGW32\bin\gcc.exe Found executable C:\MinGW32\bin\g++.exe zip_safe flag not set; analyzing archive contents... scikits.timeseries.version: module references __file__ Adding scikits

Re: Partition Recursive

2010-12-23 Thread macm
Hi urlparse isnt a option. My reasult must be: myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/', 'stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] re module is slow. Even I make a loop in urlparse.urlsplit I can lost specialMean

Re: Partition Recursive

2010-12-23 Thread Jon Clements
On Dec 23, 5:26 pm, macm wrote: > Hi Folks > > I have this: > > url = 'http://docs.python.org/dev/library/stdtypes.html? > highlight=partition#str.partition' > > So I want convert to > > myList = > ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?'

Re: Partition Recursive

2010-12-23 Thread MRAB
On 23/12/2010 17:26, macm wrote: Hi Folks I have this: url = 'http://docs.python.org/dev/library/stdtypes.html? highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','='

Re: Python Web App

2010-12-23 Thread Octavian Rasnita
From: "Daniel Fetchinson" > Anybody know where I can find a Python Development Environment in the > form of a web app for use with Chrome OS. I have been looking for a > few days and all i have been able to find is some old discussions with > python developers talking about they w

Partition Recursive

2010-12-23 Thread macm
Hi Folks I have this: url = 'http://docs.python.org/dev/library/stdtypes.html? highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partiti

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 15:37, schrieb Benedict Verheyen: On 23/12/2010 14:09, Benedict Verheyen wrote: I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python

Re: simple games w/o pygame

2010-12-23 Thread William Gill
Thanks everyone. These references will help greatly. I was about to take some javascript examples and rewrite them in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hosting a Python based TCP server

2010-12-23 Thread Jon Clements
On Dec 23, 12:01 pm, Oltmans wrote: > Hi all, > > I'm writing a very small TCP server(written in Python) and now I want > to host it on some ISP so that it can be accessed anywhere from the > Internet. I've never done that before so I thought I should ask for > some advice. Do you guys know any go

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Benedict Verheyen
On 23/12/2010 14:09, Benedict Verheyen wrote: > > I started from scratch. > I tried to build readline 6 and 5, and installing the packages system wide > as opposed to $HOME/local, but everytime Python fails to find it. > > On stable, apt-get build-dep python 2.6 doesn't work, but > apt-get build

Re: Hosting a Python based TCP server

2010-12-23 Thread Dan M
On Thu, 23 Dec 2010 04:01:03 -0800, Oltmans wrote: > Hi all, > > I'm writing a very small TCP server(written in Python) and now I want to > host it on some ISP so that it can be accessed anywhere from the > Internet. I've never done that before so I thought I should ask for some > advice. Do you

Re: Python Web App

2010-12-23 Thread Daniel Fetchinson
Anybody know where I can find a Python Development Environment in the form of a web app for use with Chrome OS. I have been looking for a few days and all i have been able to find is some old discussions with python developers talking about they will want one for the OS to be a

hot

2010-12-23 Thread paulraj
http://srbc2010.blogspot.com http://srbcmusic.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Benedict Verheyen
On 23/12/2010 11:00, Stefan Sonnenberg-Carstens wrote: > apt-get build-dep python 2.6 > should do, the dependencies haven't changed (IMHO). > Then wipe away $HOME/usr/local (if you can, btw), > reset all env vars to default (perhaps reboot). > Then untar python from scratch, cd into that dir, and

Re: Hosting a Python based TCP server

2010-12-23 Thread Adam Tauno Williams
On Thu, 2010-12-23 at 04:40 -0800, bobicanprogram wrote: > On Dec 23, 7:01 am, Oltmans wrote: > > Hi all, > > I'm writing a very small TCP server(written in Python) and now I want > > to host it on some ISP so that it can be accessed anywhere from the > > Internet. I've never done that before so I

Re: Hosting a Python based TCP server

2010-12-23 Thread python
Rolf, > I'm writing a very small TCP server (written in Python) and now I want to > host it on some ISP so that it can be accessed anywhere from the Internet. > I've never done that before so I thought I should ask for some advice. Do you > guys know any good ISP that can let me do that? I'm a

Re: Hosting a Python based TCP server

2010-12-23 Thread bobicanprogram
On Dec 23, 7:01 am, Oltmans wrote: > Hi all, > > I'm writing a very small TCP server(written in Python) and now I want > to host it on some ISP so that it can be accessed anywhere from the > Internet. I've never done that before so I thought I should ask for > some advice. Do you guys know any goo

Hosting a Python based TCP server

2010-12-23 Thread Oltmans
Hi all, I'm writing a very small TCP server(written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? Most importantl

Re: Unable to decode file written by C++ wostringstream

2010-12-23 Thread Ulrich Eckhardt
Yan Cheng CHEOK wrote: > Currently, I have the following text file > (https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirects=0&d=1) > written by C++ wostringstream. Stringstream? I guess you meant wofstream, or? Anyway, the output encoding of C++ iostreams is implementation-defined

Re: How to pop the interpreter's stack?

2010-12-23 Thread Carl Banks
On Dec 22, 7:22 pm, Steven D'Aprano wrote: > There should be a mechanism for Python functions to distinguish between > unexpected exceptions (commonly known as "bugs"), which should be > reported as coming from wherever they come from, and documented, expected > exceptions, which should be reporte

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 10:04, schrieb Benedict Verheyen: On 22/12/2010 18:47, Stefan Sonnenberg-Carstens wrote: Am 22.12.2010 09:33, schrieb Benedict Verheyen: Did you try apt-get install build-essential apt-get build-dep python2.7 before trying to compile ? Anyway, the config.log file is always of

Re: Unable to decode file written by C++ wostringstream

2010-12-23 Thread jmfauth
On 23 Dez., 09:33, Yan Cheng CHEOK wrote: > Currently, I have the following text file > (https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirect...) > written by C++ wostringstream. > The coding of the file is utf-16le. You should take care of this coding when you *read* the file,

Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)

2010-12-23 Thread Benedict Verheyen
On 22/12/2010 18:47, Stefan Sonnenberg-Carstens wrote: > Am 22.12.2010 09:33, schrieb Benedict Verheyen: >> > Did you try > > apt-get install build-essential > apt-get build-dep python2.7 > > before trying to compile ? > > Anyway, the config.log file is always of special interest. > Btw, which

Re: using python ftp

2010-12-23 Thread Octavian Rasnita
Can this lib also work with ftps? Thanks. Octavian - Original Message - From: "Anurag Chourasia" To: "Matt Funk" Cc: Sent: Thursday, December 23, 2010 4:12 AM Subject: Re: using python ftp > Hi Matt, > > I have a snippet to "upload" files (that match a particular search > pattern)

Unable to decode file written by C++ wostringstream

2010-12-23 Thread Yan Cheng CHEOK
Currently, I have the following text file (https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirects=0&d=1) written by C++ wostringstream. What I want to do it, I want to write a python script which accept user browser request, and then send over the entire file for user to downloa