Re: Talking to a usb device (serial terminal)

2008-03-04 Thread Tim Roberts
blaine <[EMAIL PROTECTED]> wrote: > >...I haven't been able to find many resources specifically in >this area, but there are a few package that are vaguely mentioned, >including fcntl and termios. But the web doesn't seem to have a lot >of documentation on fcntl, particularly information thats fro

Re: Delete hidden files on unix

2008-03-04 Thread Tim Roberts
loial <[EMAIL PROTECTED]> wrote: > >How can I delete hidden files on unix with python, i.e I want to do >equivalent of > >rm .lock* What did you try? I'm curious to know what you tried that didn't work, because I can't think of any obvious solution to this that would not just work. You did try

Re: Protocol for thread communication

2008-03-04 Thread Samuel
On Tue, 04 Mar 2008 22:12:00 -0700, Michael Torrie wrote: > Does anyone have any recommended ideas/ways of implementing a proper > control and status protocol for communicating with threads? I have a > program that spawns a few worker threads, and I'd like a good, clean way > of communicating the

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
On Mar 4, 10:57 pm, [EMAIL PROTECTED] wrote: > > > > >> >> 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 > > > > >> > ... >

Re: Altering imported modules

2008-03-04 Thread Tro
On Tuesday 04 March 2008, Steve Holden wrote: > >> Are you trying to interfere with the default module on only your > >> machine? Just rename it. If something in the std. lib. imports > >> asyncore, they get yours too that way. > > > > No, I'd like it to be a generalized solution and only for thi

Re: Altering imported modules

2008-03-04 Thread Tro
On Tuesday 04 March 2008, Floris Bruynooghe wrote: > 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 neve

Protocol for thread communication

2008-03-04 Thread Michael Torrie
Does anyone have any recommended ideas/ways of implementing a proper control and status protocol for communicating with threads? I have a program that spawns a few worker threads, and I'd like a good, clean way of communicating the status of these threads back to the main thread. Each thread (wrap

popening a process in a specific working directory

2008-03-04 Thread Michael Torrie
I have a small multi-threaded program that spawns a number of threads that each spawn a particular process in a particular temporary directory. My problem is that using os.chdir to change the working directory before popening the process doesn't always work because another thread might change the

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
> > > >> >> 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): > > > >> >   File "", line

Re: Talking to a usb device (serial terminal)

2008-03-04 Thread Grant Edwards
On 2008-03-04, blaine <[EMAIL PROTECTED]> wrote: >> 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 appropria

Re: is there enough information?

2008-03-04 Thread castironpi
> How does it work?  From reading threading.py, _Condition.wait() > acquires self.lock() too many times-- that is, once to call wait > ("cannot wait on un-aquired lock"), and once after--- are "all > waiters" waiting back at self.acquire, just to make it to > self.notify... and only one at a time a

SV: SV: Polymorphism using constructors

2008-03-04 Thread K Viltersten
> What does "SV" in the subject mean? Probably, it's an abbreviation of "svar", which means "reply". -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambition - lack of sense to be lazy -- http://mail.python.org/mailman/listinfo/pyt

Re: is there enough information?

2008-03-04 Thread castironpi
On Mar 4, 5:59 pm, David Bolen <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > > > > > > > On Mon, 3 Mar 2008 08:11:43 -0500, Jean-Paul Calderone > > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >> I'm not sure, but you seem to be implying that t

Re: SV: Polymorphism using constructors

2008-03-04 Thread Jeff Schwab
Tommy Grav wrote: > > On Mar 4, 2008, at 4:53 PM, Jeff Schwab wrote: > >> What does "SV" in the subject mean? > > SV = "Svar" is the Norwegian word for Reply. Thanks. Serves me right for not speaking Norwegian. -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
On Mar 4, 9:53 pm, [EMAIL PROTECTED] wrote: > > >> >> 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 l

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
On Mar 4, 9:01 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 05 Mar 2008 00:30:26 -0200, <[EMAIL PROTECTED]> escribió: > > > On Mar 4, 8:11 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >> En Tue, 04 Mar 2008 16:45:40 -0200, <[EMAIL PROTECTED]> escribió: > > >> >> Can you over

Re: multiplication of lists of strings

2008-03-04 Thread castironpi
On Mar 4, 9:46 pm, Jason Galyon <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Tue, 04 Mar 2008 23:50:49 -0200, Jason <[EMAIL PROTECTED]> escribió: > > >> How could I return a list or tuple of each unique combination of a given > >> set of lists (perhaps from a dict or a list).  This

Re: multiplication of lists of strings

2008-03-04 Thread Jason Galyon
Gabriel Genellina wrote: > En Tue, 04 Mar 2008 23:50:49 -0200, Jason <[EMAIL PROTECTED]> escribió: > >> How could I return a list or tuple of each unique combination of a given >> set of lists (perhaps from a dict or a list). This means the number of >> lists are not known nor is the length of ea

Re: Run Python app at startup

2008-03-04 Thread Gabriel Genellina
En Tue, 04 Mar 2008 16:36:03 -0200, SMALLp <[EMAIL PROTECTED]> escribió: >>> 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 >>> MyApp /t REG_SZ /d C:\myapp.exe

Re: Difference between 'function' and 'method'

2008-03-04 Thread Gabriel Genellina
En Wed, 05 Mar 2008 00:30:26 -0200, <[EMAIL PROTECTED]> escribió: > On Mar 4, 8:11 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Tue, 04 Mar 2008 16:45:40 -0200, <[EMAIL PROTECTED]> escribió: >> >> >> Can you overload -type-'s decision of what to 'bind'?... whenever it >> >> is it makes

Re: for-else

2008-03-04 Thread castironpi
That you could do yourself, CMIIW correct me if I'm wrong. try:     for foo in iterex( bar_sequence ): >         # normal iteration >         spam(foo) >         if funky(foo): >             break     except StopIterationEx, exc: >         # the iterator stopped normally >         eggs(exc) >

Re: multiplication of lists of strings

2008-03-04 Thread Gabriel Genellina
En Tue, 04 Mar 2008 23:50:49 -0200, Jason <[EMAIL PROTECTED]> escribió: > How could I return a list or tuple of each unique combination of a given > set of lists (perhaps from a dict or a list). This means the number of > lists are not known nor is the length of each. Use the Google interfase fo

Re: Polymorphism using constructors

2008-03-04 Thread castironpi
On Mar 4, 7:06 pm, Tommy Grav <[EMAIL PROTECTED]> wrote: > On Mar 4, 2008, at 4:53 PM, Jeff Schwab wrote: > > > What does "SV" in the subject mean? > > SV = "Svar" is the Norwegian word for Reply. > > Cheers >    Tommy It is also the name of my lockermate in grade school. "So, Svar, how 'bout the

Re: Difference between 'function' and 'method'

2008-03-04 Thread castironpi
On Mar 4, 8:11 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 04 Mar 2008 16:45:40 -0200, <[EMAIL PROTECTED]> escribió: > > >> > So, to answer your question: what you are decorating are functions,   > >> not > >> > methods. > > >> Can you overload -type-'s decision of what to 'bind'?.

Re: Difference between 'function' and 'method'

2008-03-04 Thread Gabriel Genellina
En Tue, 04 Mar 2008 16:45:40 -0200, <[EMAIL PROTECTED]> escribió: >> > 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, Met

multiplication of lists of strings

2008-03-04 Thread Jason
How could I return a list or tuple of each unique combination of a given set of lists (perhaps from a dict or a list). This means the number of lists are not known nor is the length of each. Here is an example: fruit = ['apple', 'orange'] numbers = ['one', 'two', 'three'] names = ['joe'] Order m

Re: SV: Polymorphism using constructors

2008-03-04 Thread Tommy Grav
On Mar 4, 2008, at 4:53 PM, Jeff Schwab wrote: > What does "SV" in the subject mean? SV = "Svar" is the Norwegian word for Reply. Cheers Tommy -- http://mail.python.org/mailman/listinfo/python-list

Latest XML Parsing/Memory benchmark

2008-03-04 Thread jimmy Zhang
The latest benchmark results are now available using the latest Intel Core2 Duo processor. In summary, VTD-XML using JDK 1.6's server JVM achieved an astonishing 120MB/sec sustained throughput per core on a Core2 Duo 2.5 GHz processor. * Parsing Only: http://www.ximpleware.com/2.3/benchmark_2

Re: for-else

2008-03-04 Thread Ben Finney
[EMAIL PROTECTED] writes: > But then this article: > http://tratt.net/laurie/tech_articles/articles/the_high_risk_of_novel_language_features > has shown me that my problems with the 'else' of the 'for' mostly > come from just its bad naming. The converge language is yet another > very Python-like

Re: is there enough information?

2008-03-04 Thread David Bolen
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Mon, 3 Mar 2008 08:11:43 -0500, Jean-Paul Calderone > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> I'm not sure, but you seem to be implying that the only way to use Windows' >> asynchronous I/O APIs is with threads. Actu

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

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: '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: 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: 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: 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: 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 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: 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: 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: 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

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: 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

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: 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: 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: 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: '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: 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: 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 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, 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

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

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():

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

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: 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: 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: 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

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 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

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: 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: 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

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: 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: 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) >

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: 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

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: 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: 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: 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()

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: 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 .

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: tab completion?

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

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: 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 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: 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: 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: 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 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: 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

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

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: 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: 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 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: 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 >

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: 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

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: 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: 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: 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

  1   2   >