Difference between 'function' and 'method'

2008-03-04 Thread 甜瓜
Howdy everyone, This is a big problem puzzles me for a long time. The core question is: How to dynamically create methods on a class or an instance? Let me state it step by step. 1. def gunc(self): pass class A(object): def func(self): pass a = A() a.func # gives "bound met

Re: Command line arguments in Windows

2008-03-04 Thread Chris
On Mar 4, 8:38 am, "Mike Walker" <[EMAIL PROTECTED]> wrote: > > If you run a python file, ie. just double clicking it the only > > argument you will have will be the filename of the script. If you > > create a shortcut to the script and in the target box add your > > arguments (if you have quotati

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Erik Max Francis
Mensanator wrote: > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: >> Mensanator wrote: >>> I'm not hard to please at all. >> No, of course not, since logically you must think all software is useless. > > Somehow, I expected better logic from people who call themselves > programm

ANN: EasyExtend 3.0 - beta1 released

2008-03-04 Thread Kay Schluehr
After more than half a year of work I released the first beta of EasyExtend 3.0 today. EasyExtend 3.0 is the second major redesign of EasyExtend. To gain more power and simplicity I implemented a new parser generator from the scratch called "Trail". Trail unifies several aspects of EasyExtend. It i

Re: Trouble using XML Reader

2008-03-04 Thread Mike D
On 3/3/08, Mike D <[EMAIL PROTECTED]> wrote: > > Hello, > > I'm using XML Reader (xml.sax.xmlreader.XMLReader) to create an rss > reader. > > I can parse the file but am unsure how to extract the elements I require. > For example: For each element I want the title and description. > > I have some

Re: tools to install not in python tree?

2008-03-04 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > I have some materials for a project that I am working on that I keep > in a source code control system (svn now, but I'm experimenting with > mercurial). I want to install these things from the repository, but > not into site-packages/ as Distutils wants to

Re: Difference between 'function' and 'method'

2008-03-04 Thread Paul Boddie
On 4 Mar, 09:22, "甜瓜" <[EMAIL PROTECTED]> wrote: > > This is a big problem puzzles me for a long time. The core question is: > How to dynamically create methods on a class or an instance? > > Let me state it step by step. > 1. > def gunc(self): > pass > class A(object): > def func(self

Re: tools to install not in python tree?

2008-03-04 Thread M.-A. Lemburg
On 2008-03-04 02:55, [EMAIL PROTECTED] wrote: > Hello, > > I have some materials for a project that I am working on that I keep > in a source code control system (svn now, but I'm experimenting with > mercurial). I want to install these things from the repository, but > not into site-packages/ as

Re: Python logging: Retrieving the last log record from a handler

2008-03-04 Thread Vinay Sajip
On Mar 3, 11:41 am, Frank Aune <[EMAIL PROTECTED]> wrote: > I will be fairly surprised if this functionality is not already built-in for > the defaultlogginghandlers, but so far I've been unable to figure out how > to pull it of without the custom loghandler above. Prepare to be surprised ;-) Exc

Re: tools to install not in python tree?

2008-03-04 Thread commander_coder
Thank you for the helpful replies. I shall check out the links. (I looked at some setup.py's but mxBase was not among them.) Regards, Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'function' and 'method'

2008-03-04 Thread Bruno Desthuilliers
?? a écrit : > Howdy everyone, > > This is a big problem puzzles me for a long time. The core question is: > How to dynamically create methods on a class or an instance? class Foo(object): pass def bar(self, arg): print "in bar : self == % - arg == %s" % (self, str(arg)) def baaz(s

Re: Command line arguments in Windows

2008-03-04 Thread Steve Holden
Chris wrote: > On Mar 4, 8:38 am, "Mike Walker" <[EMAIL PROTECTED]> wrote: >>> If you run a python file, ie. just double clicking it the only >>> argument you will have will be the filename of the script. If you >>> create a shortcut to the script and in the target box add your >>> arguments (if y

Re: Embedding a literal "\u" in a unicode raw string.

2008-03-04 Thread NickC
On Feb 26, 8:45 am, rmano <[EMAIL PROTECTED]> wrote: > BTW, 2to3.py should warn when a raw string (not unicode) with \u in > it, I think. > I tried it and it seems to ignore the problem... Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]

Eurosymbol in xml document

2008-03-04 Thread Hellmut Weber
Hi, i'm new here in this list. i'm developing a little program using an xml document. So far it's easy going, but when parsing an xml document which contains the EURO symbol ('€') then I get an error: UnicodeEncodeError: 'charmap' codec can't encode character u'\xa4' in position 11834: charact

Re: Eurosymbol in xml document

2008-03-04 Thread Diez B. Roggisch
Hellmut Weber wrote: > Hi, > i'm new here in this list. > > i'm developing a little program using an xml document. So far it's easy > going, but when parsing an xml document which contains the EURO symbol > ('€') then I get an error: > > UnicodeEncodeError: 'charmap' codec can't encode character

Removing default logging handler (causes duplicate logging)

2008-03-04 Thread Gal Aviel
Hello All, I want to add a logger to my application, then addHandler to it to log to a special destination. Unfortunately when I use logging.getLogger("my_logger") to create the new logger, it apparently comes with a default handler that logs to STDOUT (or STDERR?). When I add my special handler

Re: Eurosymbol in xml document

2008-03-04 Thread Stephan Diehl
Hallo Helmut, > Hi, > i'm new here in this list. > > i'm developing a little program using an xml document. So far it's easy > going, but when parsing an xml document which contains the EURO symbol > ('€') then I get an error: > > UnicodeEncodeError: 'charmap' codec can't encode character u'\xa4

Re: News from Jython world

2008-03-04 Thread Ant
On Mar 3, 6:40 pm, Sébastien Boisgérault <[EMAIL PROTECTED]> wrote: > Frank Wierzbicki and Ted Leung have been hired by Sun. Frank is a > key Jython developer and is specifically hired to work full time on > Jython, a version of the Python interpreter that runs on top of the > JVM and provides full

Re: Eurosymbol in xml document

2008-03-04 Thread Robert Bossy
Diez B. Roggisch wrote: > Hellmut Weber wrote: > > >> Hi, >> i'm new here in this list. >> >> i'm developing a little program using an xml document. So far it's easy >> going, but when parsing an xml document which contains the EURO symbol >> ('€') then I get an error: >> >> UnicodeEncodeError:

Re: pySQLite Insert speed

2008-03-04 Thread mmm
Steve, I think you were right the first time is saying > it should really be this: > sqlxb= 'INSERT INTO DTABLE2 VALUES (?, ?, ?, ?)' my copy.copy() has the equivalent effect. Running this test code produces the output below import copy print 'Test 1' pf= '?,?,?,?' sqlx1= 'INSERT INTO DTABLE

Re: pySQLite Insert speed

2008-03-04 Thread Steve Holden
mmm wrote: > Steve, I think you were right the first time is saying > >> it should really be this: >> sqlxb= 'INSERT INTO DTABLE2 VALUES (?, ?, ?, ?)' > > my copy.copy() has the equivalent effect. > > Running this test code produces the output below > > import copy > > print 'Test 1' > pf= '?

for-else

2008-03-04 Thread bearophileHUGS
So far in Python I've almost hated the 'else' of the 'for' loops: - I have problems to remember its meaning; - It gives me little problems when I later want to translate Python code to other languages (and you always have to translate long-lived code). - I have used it only once, so far. So so far

Re: Eurosymbol in xml document

2008-03-04 Thread Diez B. Roggisch
> If the file is declared as latin-1 and contains an euro symbol, then the > file is actually invalid since euro is not defined of in iso-8859-1. If > there is no encoding declaration, as Diez already said, the file should > be encoded as utf-8. > You are right of course - latin1 doesn't contain

Re: How about adding rational fraction to Python?

2008-03-04 Thread NickC
On Mar 4, 7:11 am, Lie <[EMAIL PROTECTED]> wrote: > On Mar 2, 11:36 pm, Paul Rubin wrote: > > > > Try with a=7, b=25 > > > > They should still compare true, but they don't. The reason why they > > > don't is because of float's finite precision, which is not exactly > > >

Re: 'normal' shell with curses

2008-03-04 Thread Thynnus
On 3/3/2008 9:57 PM, Michael Goerz wrote: > Hi, > > I'm trying to print out text in color. As far as I know, curses is the > only way to do that (or not?). So, what I ultimately want is a curses > terminal that behaves as closely as possible as a normal terminal, i.e. > it breaks lines and scro

Re: Eurosymbol in xml document

2008-03-04 Thread Richard Brodie
"Robert Bossy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If the file is declared as latin-1 and contains an euro symbol, then the file > is > actually invalid since euro is not defined of in iso-8859-1. Paradoxical would be a better description than invalid, if it contains

Re: pySQLite Insert speed

2008-03-04 Thread Peter Otten
Steve Holden wrote: > What I will repeat, however, is that while there is a *slight* > difference is semantics between > > s = "some string" > s1 = s > > and > > s = "some string" > s1 = copy.copy(s) > > that difference is only to ensure that s and s1 point to different > copies of the same st

Re: How about adding rational fraction to Python?

2008-03-04 Thread Mark Dickinson
On Mar 4, 8:46 am, NickC <[EMAIL PROTECTED]> wrote: > The increased number of inaccurate answers with Decimal (31% vs 10%) > is probably due to the fact that it is actually more precise than > float I suspect it has more to do with the fact that 10 is bigger than 2, though I'm not sure I could pre

http server performance

2008-03-04 Thread bharath venkatesh
hi, my project involves lot of I/O over the network.. one part of my project involves a server(http) which is listening on the port for many client . this sever fetches an image from the web and and send it to clients and many clients will request the server concurrently .. to imple

Re: Talking to a usb device (serial terminal)

2008-03-04 Thread blaine
> > It looks like the fastest speed supported by python termios on > Linux is B460800 (uses a constant of 0x1004). If you look in > /usr/include/..., baud rates do go up to 921600 (which uses a > constant of 0x1007). > > Try using the appropriate constant from /usr/include/... (for > the target pl

Re: pySQLite Insert speed

2008-03-04 Thread Steve Holden
Peter Otten wrote: > Steve Holden wrote: > >> What I will repeat, however, is that while there is a *slight* >> difference is semantics between >> >> s = "some string" >> s1 = s >> >> and >> >> s = "some string" >> s1 = copy.copy(s) >> >> that difference is only to ensure that s and s1 point to di

Re: How about adding rational fraction to Python?

2008-03-04 Thread Gabriel Genellina
En Tue, 04 Mar 2008 11:46:48 -0200, NickC <[EMAIL PROTECTED]> escribi�: > A mildly interesting Py3k experiment: > > Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 > Type "help", "copyright", "credits" or "license" for more i

Re: Altering imported modules

2008-03-04 Thread Tro
On Monday 03 March 2008, [EMAIL PROTECTED] wrote: > On Mar 3, 5:09 pm, Tro <[EMAIL PROTECTED]> wrote: > > On Sunday 02 March 2008, Paul McGuire wrote: > > > On Mar 2, 3:48 pm, Tro <[EMAIL PROTECTED]> wrote: > > > > On Sunday 02 March 2008, Terry Reedy wrote: > > > > > "Tro" <[EMAIL PROTECTED]> wrot

Re: pySQLite Insert speed

2008-03-04 Thread mmm
Oops I did make a mistake. The code I wanted to test should have been import copy print 'Test 1' pf= '?,?,?,?' sqlx1= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf print sqlx1 print print 'Test 2' sqlx2= copy.copy(sqlx1) sqlx3= sqlx1 pf= '?,?,?, ' print 'sqlx1= ', sqlx1 print 'sqlx2= ', sqlx2 pr

Re: why not bisect options?

2008-03-04 Thread rbossy
Quoting Raymond Hettinger <[EMAIL PROTECTED]>: > [Robert Bossy] > > I thought it would be useful if insort and consorts* could accept the > > same options than list.sort, especially key and cmp. > > If you're going to do many insertions or searches, wouldn't it be > *much* more efficient to store

tab completion?

2008-03-04 Thread Siddhant
Hi people. I was just wondering if a tab-completion feature in python command line interface would be helpful? If yes, then how can I implement it? Thanks, Siddhant -- http://mail.python.org/mailman/listinfo/python-list

Re: for-else

2008-03-04 Thread Carl Banks
On Mar 4, 8:27 am, [EMAIL PROTECTED] wrote: > So far in Python I've almost hated the 'else' of the 'for' loops: > - I have problems to remember its meaning; > - It gives me little problems when I later want to translate Python > code to other languages (and you always have to translate long-lived >

Re: tab completion?

2008-03-04 Thread james . pye
On Mar 4, 8:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > Hi people. > I was just wondering if a tab-completion feature in python command > line interface would be helpful? > If yes, then how can I implement it? > Thanks, > Siddhant Is this what you are looking for? http://docs.python.org/lib/m

Re: Removing default logging handler (causes duplicate logging)

2008-03-04 Thread Gerard Flanagan
On Mar 4, 1:29 pm, Gal Aviel <[EMAIL PROTECTED]> wrote: > Hello All, > > I want to add a logger to my application, then addHandler to it to log to a > special destination. > > Unfortunately when I use logging.getLogger("my_logger") to create the new > logger, it apparently comes with a default hand

Re: tab completion?

2008-03-04 Thread Ron DuPlain
On Mar 4, 10:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > Hi people. > I was just wondering if a tab-completion feature in python command > line interface would be helpful? > If yes, then how can I implement it? > Thanks, > Siddhant ipython provides auto tab completion. http://ipython.scipy.org/

Re: for-else

2008-03-04 Thread BJörn Lindqvist
On Tue, Mar 4, 2008 at 4:17 PM, Carl Banks <[EMAIL PROTECTED]> wrote: > > for ...: > > ... > > exhausted: > > ... > > broken: > > ... > > > > The meaning is explicit. While "else" seems to mean little there. > > So I may like something similar for Python 3.x (or the removal of

Re: for-else

2008-03-04 Thread Tim Chase
> For instance, if you have a (trivial) if...elif...else like this: > > if a == 0: > do_task_0() > elif a == 1: > do_task_1() > elif a == 2: > do_task_2() > else: > do_default_task() > > You could roll it up into a for...else statement like this: > > for i in range(3): > if a

HTTP keep-alive performance

2008-03-04 Thread Manuel Metz
Hi all, I tried to use the HTTP keep-alive (HTTP/1.1) mechanism for an xmlrpc server/client session. This worked fine, after I found out how to fix the client, see: http://mail.python.org/pipermail/python-list/2004-April/256360.html and also http://mail.python.org/pipermail/python-list/2007-Ma

Re: Altering imported modules

2008-03-04 Thread Steve Holden
Tro wrote: > On Monday 03 March 2008, [EMAIL PROTECTED] wrote: >> On Mar 3, 5:09 pm, Tro <[EMAIL PROTECTED]> wrote: >>> On Sunday 02 March 2008, Paul McGuire wrote: On Mar 2, 3:48 pm, Tro <[EMAIL PROTECTED]> wrote: > On Sunday 02 March 2008, Terry Reedy wrote: >> "Tro" <[EMAIL PROTECTE

Re: pySQLite Insert speed

2008-03-04 Thread Steve Holden
mmm wrote: > Oops I did make a mistake. The code I wanted to test should have been > > import copy > print 'Test 1' > pf= '?,?,?,?' > sqlx1= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf > print sqlx1 > > print > print 'Test 2' > sqlx2= copy.copy(sqlx1) > sqlx3= sqlx1 > pf= '?,?,?, ' > print 'sq

Re: Altering imported modules

2008-03-04 Thread Floris Bruynooghe
On Mar 1, 11:56 pm, Tro <[EMAIL PROTECTED]> wrote: > I'd like to know if it's possible to make tlslite load *my* asyncore module > without changing any of the tlslite code. the pkgutil module might be helpful, not sure though as I've never used it myself. http://blog.doughellmann.com/2008/02/pymo

Re: tab completion?

2008-03-04 Thread [EMAIL PROTECTED]
On Mar 4, 10:44 am, Ron DuPlain <[EMAIL PROTECTED]> wrote: > On Mar 4, 10:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > > > Hi people. > > I was just wondering if a tab-completion feature in python command > > line interface would be helpful? > > If yes, then how can I implement it? > > Thanks, > >

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Lie
On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > Mensanator wrote: > > > While we're on the subject of English, the word "worthless" > > > means "has no value". So, a program that doesn't work would > > > generally be "

Re: 'normal' shell with curses

2008-03-04 Thread Michael Goerz
Thynnus wrote, on 03/04/2008 08:48 AM: > On 3/3/2008 9:57 PM, Michael Goerz wrote: >> Hi, >> >> I'm trying to print out text in color. As far as I know, curses is the >> only way to do that (or not?). So, what I ultimately want is a curses >> terminal that behaves as closely as possible as a norm

Re: tab completion?

2008-03-04 Thread Siddhant
Yes. Almost what I wanted. Thanks. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: why not bisect options?

2008-03-04 Thread Aaron Watters
On Feb 29, 9:31 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi all, > > I thought it would be useful if insort and consorts* could accept the > same options than list.sort, especially key and cmp. Wouldn't this make them slower and less space efficient? It would be fine to add something lik

Re: for-else

2008-03-04 Thread Carl Banks
On Mar 4, 10:55 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On Tue, Mar 4, 2008 at 4:17 PM, Carl Banks <[EMAIL PROTECTED]> wrote: > > > for ...: > > > ... > > > exhausted: > > > ... > > > broken: > > > ... > > > > The meaning is explicit. While "else" seems to mean little

Re: why not bisect options?

2008-03-04 Thread Robert Bossy
Aaron Watters wrote: > On Feb 29, 9:31 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > >> Hi all, >> >> I thought it would be useful if insort and consorts* could accept the >> same options than list.sort, especially key and cmp. >> > > Wouldn't this make them slower and less space effici

Re: Talking to a usb device (serial terminal)

2008-03-04 Thread Grant Edwards
On 2008-03-04, blaine <[EMAIL PROTECTED]> wrote: >> Try using the appropriate constant from /usr/include/... (for >> the target platform, of course). >> >> -- >> Grant Edwards grante Yow! Please come home with >> at me .

unicode box drawing

2008-03-04 Thread jefm
How can I print the unicode box drawing characters in python: print u'\u2500' print u'\u2501' print u'\u2502' print u'\u2503' print u'\u2504' Traceback (most recent call last): File "\test.py", line 3, in ? print u'\u2500' File "C:\Python24\lib\encodings\cp1252.py", line 18, in encode

Re: for-else

2008-03-04 Thread Shane Geiger
> if a == 0: > do_task_0() > elif a == 1: > do_task_1() > elif a == 2: > do_task_2() > else: > do_default_task() The if-elif-else structure that calls functions (like that above) can be avoided with the code below: def foo0(): print 'foo0' def bar0(): print 'bar0' def foo1()

Re: sympy: what's wrong with this picture?

2008-03-04 Thread castironpi
On Mar 4, 10:50 am, Lie <[EMAIL PROTECTED]> wrote: > On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > > Mensanator wrote: > > > > While we're on the subject of English, the word "worthless" > > > > means "ha

Re: metaclasses

2008-03-04 Thread castironpi
On Mar 4, 12:51 am, Gerard Flanagan <[EMAIL PROTECTED]> wrote: > On Mar 4, 6:31 am, [EMAIL PROTECTED] wrote: > > > > > > > On Mar 3, 10:01 pm, Benjamin <[EMAIL PROTECTED]> wrote: > > > > On Mar 3, 7:12 pm, [EMAIL PROTECTED] wrote: > > > > > What are metaclasses? > > > > Depends on whether you want

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
On Mar 4, 5:27 am, Bruno Desthuilliers wrote: > ?? a écrit : > > > Howdy everyone, > > >      This is a big problem puzzles me for a long time. The core question is: > > How to dynamically create methods on a class or an instance? > > class Foo(object): >     pass > > def bar(self, arg): >     pri

Re: is there enough information?

2008-03-04 Thread castironpi
On Mar 3, 10:34 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 3 Mar 2008 07:00:55 -0800 (PST), [EMAIL PROTECTED] declaimed > the following in comp.lang.python: > > > What's the API call for it? > >         I'd suspect one of the win32event.WaitFor..., when combined with > win32file.Cre

ANN: Resolver One 1.0.1

2008-03-04 Thread Giles Thomas
Hi! We're delighted to announce version 1.0.1 of Resolver One, a Windows spreadsheet/IDE mashup that can be programmed in IronPython. As you enter formulae on the grid, it writes the equivalent IronPython program for you. As you add your own code, the grid is updated. This allows you to build ap

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Nanjundi
On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > Notice anything funny about the "random" choices? > > import sympy > import time > import random > > f = [i for i in sympy.primerange(1000,1)] > > for i in xrange(10): > f1 = random.choice(f) > print f1, > f2 = random.choice(f) >

Re: Run Python app at startup

2008-03-04 Thread SMALLp
Gabriel Genellina wrote: > En Sun, 02 Mar 2008 19:37:35 -0200, SMALLp <[EMAIL PROTECTED]> escribi�: > >> Hy. >> I create simple application. Yust an windows and "compile" it with >> py2exe. I add registry value >> reg add >> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v >>

Re: for-else

2008-03-04 Thread castironpi
Would you like it to be removed or its name changed? You can do it with a special iteration: for a in B: if behavior break else: 2behavior > class KeepResult:... kr= KeepResult( B ) for a in kr: if behavior break if kr.diditbreak?: 2behavior (if not: 3behavior) I

Edit MP4 and/or WMV file metadata?

2008-03-04 Thread allen.fowler
Hello, I have many WMV files with bad embedded author/title/date information. However, the correct information is correctly encoded in the file name.. i.e. "title-author-date.wmv" I am about to conver these fiiles to MP$ for use on an iPod. The video software I am using will, I think, transfer t

Re: XML Schema validation in Python

2008-03-04 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I tested and tried a few XML validators but none of them is able to > successfully validate a string of xml (not a file just a string) to > programatically be able to validate messages of xml that flow in and > out of the different systems. http://codespeak.net/lxml/tuto

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
> > So, to answer your question: what you are decorating are functions, not > > methods. > > Can you overload -type-'s decision of what to 'bind'?... whenever it > is it makes it. >>> from types import FunctionType, MethodType >>> class A( FunctionType ): pass ... Traceback (most recent call last)

Re: unicode box drawing

2008-03-04 Thread Nanjundi
On Mar 4, 12:51 pm, jefm <[EMAIL PROTECTED]> wrote: > How can I print the unicode box drawing characters in python: > > print u'\u2500' > print u'\u2501' > print u'\u2502' > print u'\u2503' > print u'\u2504' > > Traceback (most recent call last): > File "\test.py", line 3, in ? > print u'\u25

Re: How about adding rational fraction to Python?

2008-03-04 Thread Mark Dickinson
On Mar 4, 9:39 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Mar 4, 8:46 am, NickC <[EMAIL PROTECTED]> wrote: > > > The increased number of inaccurate answers with Decimal (31% vs 10%) > > is probably due to the fact that it is actually more precise than > > float > > I suspect it has more to

ANN: GOZERBOT 0.8 released

2008-03-04 Thread Bart Thate
so 0.8 is there and can be downloaded from http://gozerbot.org new features: * third party addons for plugins. (needs setup.py to work) * reboots without disconnects (irc only for now) * ipv6 udp support * queues used all over the place to reduce thread usage * normal irc log

Re: How about adding rational fraction to Python?

2008-03-04 Thread Paul Rubin
Mark Dickinson <[EMAIL PROTECTED]> writes: > For randomly chosen(*) base B floats x and y, the probability that > (x/y)*y == x is approximately given by I remember hearing that IEEE 754 was carefully designed to make this identity hold as often as possible when y is a small integer. -- http://mai

Re: for-else

2008-03-04 Thread Jeffrey Froman
Carl Banks wrote: > there is a > rationale behind the name "else".  If you consider a for loop to be a > rolled-up if...elif...else statement This is an interesting angle. I've always considered "for/else" to be unintuitive, not because of "else", but because of the coupling with "for". Instead,

Python an Exchange Server

2008-03-04 Thread Yusniel
Hi friends. Someone know how to work with python and exchange server?. -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 2:44 am, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > >> Mensanator wrote: > >>> I'm not hard to please at all. > >> No, of course not, since logically you must think all software is useless. > > > So

Re: Python an Exchange Server

2008-03-04 Thread Tim Chase
> Hi friends. Someone know how to work with python and exchange > server?. I've used both imaplib[1] and smtplib[2] (in the standard library) for talking successfully with an Exchange server. I don't do much with POP3, but there's also a poplib module[3] in the standard library. I just wrote

Re: unicode box drawing

2008-03-04 Thread Marc Christiansen
jefm <[EMAIL PROTECTED]> wrote: > How can I print the unicode box drawing characters in python: > > > print u'\u2500' > print u'\u2501' > print u'\u2502' > print u'\u2503' > print u'\u2504' > > Traceback (most recent call last): > File "\test.py", line 3, in ? >print u'\u2500' > File "C:\P

SV: Polymorphism using constructors

2008-03-04 Thread K Viltersten
"Carl Banks" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > On Mar 3, 4:17 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> Since Python doesn't support having two methods with the same name, >> the usual solution is to provide alternative constructors using >> classmethod():

SV: Polymorphism using constructors

2008-03-04 Thread K Viltersten
"Diez B. Roggisch" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] >K Viltersten schrieb: >> I'm writing a class for rational numbers >> and besides the most obvious constructor >> >> def __init__ (self, nomin, denom): >> >> i also wish to have two supporting ones >> >> def __init

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 10:50 am, Lie <[EMAIL PROTECTED]> wrote: > On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > > Mensanator wrote: > > > > While we're on the subject of English, the word "worthless" > > > > means "ha

Re: for-else

2008-03-04 Thread Raymond Hettinger
[BearOphile] > So far in Python I've almost hated the 'else' of the 'for' loops FWIW, I'm very happy with for-else. Most of the time, you don't need it, but when you do, it beats the heck out of doing silly tricks with flags. The primary use case is searching a container: prep_tasks() for

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 12:32 pm, Nanjundi <[EMAIL PROTECTED]> wrote: > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > Notice anything funny about the "random" choices? > > > import sympy > > import time > > import random > > > f = [i for i in sympy.primerange(1000,1)] > > > for i in

Re: for-else

2008-03-04 Thread bearophileHUGS
Raymond HettInger: > FWIW, I'm very happy with for-else. Most of the time, you don't need > it, but when you do, it beats the heck out of doing silly tricks with > flags. I'd like it to be renamed to something more natural :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-li

Re: 'normal' shell with curses

2008-03-04 Thread Thynnus
On 3/4/2008 12:05 PM, Michael Goerz wrote: > Thynnus wrote, on 03/04/2008 08:48 AM: >> On 3/3/2008 9:57 PM, Michael Goerz wrote: >>> Hi, >>> >>> I'm trying to print out text in color. As far as I know, curses is the >>> only way to do that (or not?). So, what I ultimately want is a curses >>> ter

Re: Python an Exchange Server

2008-03-04 Thread Grant Edwards
On 2008-03-04, Tim Chase <[EMAIL PROTECTED]> wrote: > Exchange offers other proprietary functionality, exposed > through the MAPI. You might be able to use some of the Win32 > functionality in one of the add-on modules for talking with > COM objects. I spent a while looking into this a few year

Re: Python an Exchange Server

2008-03-04 Thread Mike Driscoll
On Mar 4, 1:20 pm, Yusniel <[EMAIL PROTECTED]> wrote: > Hi friends. Someone know how to work with python and exchange > server?. If you do go the COM route, you'll probably want to ask questions of the PyWin32 user's group, which can be found here: http://mail.python.org/mailman/listinfo/python-w

Re: Eurosymbol in xml document

2008-03-04 Thread Hellmut Weber
Hi, thanks to all of you who have sent me helpful information. I'm diving into the secrets of unicode. It seems the crucial point was, that seemingly during the installation of the programming environment eric the file *** /usr/lib/python2.4/site-packages/sitecustomize.py *** has been modified.

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Istvan Albert
On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > But what if _I_ wanted to make a repeatable sequence for test > purposes? Wouldn't factorint() destroy my attempt by reseeding > on every call? Would it? It may just be that you are now itching to see a problem even where there isn't one

Re: sympy: what's wrong with this picture?

2008-03-04 Thread bearophileHUGS
apatheticagnostic: > I swear, this is one of the most polite-oriented groups I've ever > seen. > Not that that's a bad thing or anything, it's nice to be nice. Yep, and with lot more work it may even become a bit fit for women/ females too. Bye, bearophile -- http://mail.python.org/mailman/listi

sqlite3 permission issue

2008-03-04 Thread chris
I am trying to execute an update to a sqlite3 db via a python cgi script. I can execute a select via a cgi script, but when I attempt an update, I get an "unable to open database file" error. But the error comes on the update statement, not on the connect. So the script has: conn = sqlite3.conn

Re: unicode box drawing

2008-03-04 Thread jefm
> on windows using python 2.4. ??? yes, as a matter of fact I am. Did not feel the need to switch to 2.5 yet. I'm gonna give this a try, but it requires me to dig up 2.5 versions of the libraries i am using. (one of them didn't at the time and that is why I stuck to 2.4) -- http://mail.python.org

Re: unicode box drawing

2008-03-04 Thread jefm
> on windows using python 2.4. ??? I was on Python 2.4.3 and it gave me that problem. I upgraded to 2.4.4 and it works. thanks for the tip. -- http://mail.python.org/mailman/listinfo/python-list

Re: for-else

2008-03-04 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | So far in Python I've almost hated the 'else' of the 'for' loops: | - I have problems to remember its meaning; Consider the following pseudoPython which you should understand: label: loop if cond: do_something() goto loop else:

Re: sqlite3 permission issue

2008-03-04 Thread chris
On Mar 4, 3:10 pm, chris <[EMAIL PROTECTED]> wrote: > I am trying to execute an update to a sqlite3 db via a python cgi > script. I can execute a select via a cgi script, but when I attempt > an update, I get an "unable to open database file" error. But the > error comes on the update statement,

Re: SV: Polymorphism using constructors

2008-03-04 Thread Jeff Schwab
What does "SV" in the subject mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 permission issue

2008-03-04 Thread Tim Chase
> I am trying to execute an update to a sqlite3 db via a python cgi If you're running as a CGI, your script (as you guess below) will usually run with the effective permissions of the web-server. Frequently, this is some user such as "wwwdata" or "www". > conn = sqlite3.connect('db') Make sure

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 3:00 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > But what if _I_ wanted to make a repeatable sequence for test > > purposes? Wouldn't factorint() destroy my attempt by reseeding > > on every call? > > Would it? I don't kno

Re: Edit MP4 and/or WMV file metadata?

2008-03-04 Thread Matej Cepl
On 2008-03-04, 18:53 GMT, allen.fowler wrote: > 1) Is there a python module I can use to edit the metadata in > MP4 > files? I am not sure whether taglib supports MP4, but take a look at http://developer.kde.org/~wheeler/taglib.html and http://developer.berlios.de/project/showfiles.php?group_id

Re: 'normal' shell with curses

2008-03-04 Thread Michael Goerz
Michael Goerz wrote, on 03/04/2008 12:05 PM: > Thynnus wrote, on 03/04/2008 08:48 AM: >> On 3/3/2008 9:57 PM, Michael Goerz wrote: >>> Hi, >>> >>> I'm trying to print out text in color. As far as I know, curses is >>> the only way to do that (or not?). So, what I ultimately want is a >>> curses t

Re: Talking to a usb device (serial terminal)

2008-03-04 Thread blaine
> It looks like the fastest speed supported by python termios on > Linux is B460800 (uses a constant of 0x1004). If you look in > /usr/include/..., baud rates do go up to 921600 (which uses a > constant of 0x1007). > > Try using the appropriate constant from /usr/include/... (for > the target pla

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Mensanator
On Mar 4, 4:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 4, 3:00 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > On Mar 4, 3:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > But what if _I_ wanted to make a repeatable sequence for test > > > purposes? Wouldn't factorint() destroy my

  1   2   >