Re: Windows Python 2.5.1 IPV6 problems

2008-02-02 Thread Martin v. Löwis
> _sock = _realsocket(family, type, proto) > TypeError: an integer is required So what values have family, type, and proto at that point? Edit socket.py to find out. Could it be that you also need to set socketType for your Port subclass? Regards, Martin -- http://mail.python.org/mailman/li

Re: Multiple interpreters retaining huge amounts of memory

2008-02-02 Thread Martin v. Löwis
> If you are going to make a comment such as 'multi-interpreter feature > doesn't really work' you really should substantiate it by pointing to > where it is documented what the problems are or enumerate yourself > exactly what the issues are. There is already enough FUD being spread > around about

[2.4.2] Compiling Python with packages?

2008-02-02 Thread Gilles Ganault
Hello I need to compile Python with the packages "socket,sys,time,os", but I've never done it before, and would like confirmation that this will work as planned: == make clean ./configure --with-socket --with-sys --with-time --with-os make make install == In addition, are there r

Re: Does anyone else use this little idiom?

2008-02-02 Thread Steven D'Aprano
On Sun, 03 Feb 2008 15:08:34 +1100, Ben Finney wrote: >> But I like using _ because it's only 1 character and communicates well >> the idea "I don't care about this variable." > > Not to me. As you noted, '_' is easily ambiguous. Explicit is better > than implicit; the name 'dummy' makes it much

Re: Does anyone else use this little idiom?

2008-02-02 Thread Steven D'Aprano
On Sat, 02 Feb 2008 18:03:54 -0800, miller.paul.w wrote: > for _ in xrange (1,n): >some code ... > So, I guess I'm wondering if anyone else uses a similar idiom and if > there are any downsides to it that I'm not aware of. Sometimes, but not often. If I'm writing a use-once-then-throw-away

Re: Multiple interpreters retaining huge amounts of memory

2008-02-02 Thread Graham Dumpleton
On Feb 2, 12:34 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Is there some way to track references per interpreter, or to get the > > memory allocator to set up seperate arenas per interpreter so that it > > can remove all allocated memory when the interpreter exits? > > No. The multi-inter

Re: psycopg2

2008-02-02 Thread Tim Roberts
Andre' John <[EMAIL PROTECTED]> wrote: > >I am trying to do this for a Postgresql database: > >conn = psycopg2.connect('host=localhost') >cur = conn.cursor() >cur.execute("SELECT * FROM names WHERE name=%s", ['S']) > >, which doesn't work, and neither does > >cur.execute("SELECT * FROM names WHERE

Re: Linux Journal Survey

2008-02-02 Thread Kay Schluehr
On Jan 24, 4:42 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > > > The annual Linux Journal survey is online now for any Linux users who > > want to vote for Python. http://www.linuxjournal.com/node/1006101 > > ... > > 18. What is your favorite progra

Windows Python 2.5.1 IPV6 problems

2008-02-02 Thread Thomas DiZoglio
Hi, I'm trying to get some IPV6 python code running under Windows. I have installed Python 2.5.1 for Windows using the binaries from python.org. I'm a newbie to Python programming as well. The code works fine under Debian and MacOSX (both using Python 2.5) I have rebuilt the python binaries from

Python feature request : operator for function composition

2008-02-02 Thread Kay Schluehr
As you know, there is no operator for function composition in Python. When you have two functions F and G and want to express the composition F o G you have to create a new closure lambda *args, **kwd: F (G (*args, **kwd)) or you write a composition in functional style compose( F, G ) None of

Re: Cool JavaScript game

2008-02-02 Thread Gerry Ford
"Hoss" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I created a cool game almost entirely with Javascript and wanted to > see what people thought. See a screenshot at > > http://lh6.google.com/todd.freed/R4Q_gtqjtcI/AeI/eeNq2xOBxGw/beem.jpg > > Its kind of a puzzle game wi

Re: fast method accessing large, simple structured data

2008-02-02 Thread agc
On Feb 2, 1:50 pm, John Machin <[EMAIL PROTECTED]> wrote: > agc wrote: > > Hi, > > > I'm looking for a fast way of accessing some simple (structured) data. > > > The data is like this: > > Approx 6 - 10 GB simple XML files with the only elements > > I really care about are the and ones. > > > So

Re: Cool JavaScript game

2008-02-02 Thread Ben Finney
Hoss <[EMAIL PROTECTED]> writes: > I created a cool game almost entirely with Javascript and wanted to > see what people thought. I think it's entirely off-topic for Python and Ruby forums, and probably for a "webmaster" forum also. -- \ "Professionalism has no place in art, and hack

Re: Does anyone else use this little idiom?

2008-02-02 Thread Ben Finney
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > Should be `for _ in xrange(n)` to match the Ruby example. Both > iterate n times. Only until Python 3.0, since the 'xrange' implementation will become 'range' at that time. http://wiki.python.org/moin/Py3kDeprecated#head-343618ffa0887790ed12

Re: Does anyone else use this little idiom?

2008-02-02 Thread Ben Finney
[EMAIL PROTECTED] writes: > When the index doesn't matter to me, I tend to write it as: > > for _ in xrange (1,n): >some code > > An alternative way of indicating that you don't care about the loop > index would be > > for dummy in xrange (1,n): >some code > > But I like using _ becaus

Re: Python noob SOS (any [former?] Perlheads out there?)

2008-02-02 Thread samwyse
kj wrote: > I'd written a Perl module to facilitate the writing of scripts. > It contained all my boilerplate code for parsing and validating > command-line options, generating of accessor functions for these > options, printing of the help message and of the full documentation, > testing, etc. A

Re: Does anyone else use this little idiom?

2008-02-02 Thread Jeff Schwab
How [EMAIL PROTECTED] wrote: > Ruby has a neat little convenience when writing loops where you don't > care about the loop index: you just do n.times do { ... some > code ... } where n is an integer representing how many times you want > to execute "some code." > > In Python, the direct translatio

GUI definition for web and desktop

2008-02-02 Thread Daniel Fetchinson
Hi pythoneans, I'm looking for a simple text based GUI definition format and associated python modules to work with it that is capable of defining simple GUI's for *both* the web and the desktop. I have an application that is accessible through the web and also through desktop applications and bot

Re: Does anyone else use this little idiom?

2008-02-02 Thread Gabriel Genellina
En Sun, 03 Feb 2008 01:03:43 -0200, James Matthews <[EMAIL PROTECTED]> escribió: Sorry to be nitpicking, but people coming from other languages may get confused by the wrong examples: > What i do is a simple range call. for i in range(number of times i want > to repeat something) > I guess

Re: Gmail imap search does not get all messages.

2008-02-02 Thread Bart Kastermans
Quick update on the below: the issue has disappeared by itself. I did not get to working on this much since sending my last message. Now that I am looking at this the issue has disappeared. On Jan 29, 8:23 pm, Bart Kastermans <[EMAIL PROTECTED]> wrote: > I am trying to use imaplib with gmail.

Re: Does anyone else use this little idiom?

2008-02-02 Thread James Matthews
What i do is a simple range call. for i in range(number of times i want to repeat something) I guess it comes from my C days for(i=0;i<100;i++) { or in python for i in range(99): On Feb 3, 2008 3:34 AM, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED]

Re: Does anyone else use this little idiom?

2008-02-02 Thread Roy Smith
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Ruby has a neat little convenience when writing loops where you don't > care about the loop index: you just do n.times do { ... some > code ... } where n is an integer representing how many times you want > to execute "some code." > > I

Does anyone else use this little idiom?

2008-02-02 Thread miller . paul . w
Ruby has a neat little convenience when writing loops where you don't care about the loop index: you just do n.times do { ... some code ... } where n is an integer representing how many times you want to execute "some code." In Python, the direct translation of this is a for loop. When the index

Re: Strange Result about Module circular rreference

2008-02-02 Thread CFAN
On 2月3日, 上午8时59分, CFAN <[EMAIL PROTECTED]> wrote: > First Set up the following files, > > m1.py > - > #Module A > import m2 > var1 = "ModuleM1" > > m2.py > - > #Module B > import m3 > var1 = "ModuleM2" > > m3.py > - > #Module C > import m1

Strange Result about Module circular rreference

2008-02-02 Thread CFAN
First Set up the following files, m1.py - #Module A import m2 var1 = "ModuleM1" m2.py - #Module B import m3 var1 = "ModuleM2" m3.py - #Module C import m1 var1 = "ModuleM3" main.py -- import m3 print m3.var1 print m

Re: Linux Journal Survey

2008-02-02 Thread Paul Boddie
On 3 Feb, 00:45, Carl Banks <[EMAIL PROTECTED]> wrote: > > Java doesn't compile to ELF binaries, last time I checked. http://gcc.gnu.org/java/ Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux Journal Survey

2008-02-02 Thread Carl Banks
On Feb 2, 12:03 pm, Albert van der Horst <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > > > > Russ P. <[EMAIL PROTECTED]> wrote: > >On Jan 23, 7:42 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > >> On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > > >> > The annual Linux Journal survey

Why chdir command doesn't work with client.get_transport() ?

2008-02-02 Thread Charles_hans
I am new to paramiko. I wrote a script to copy files between Solaris and XP machines as below: import paramiko def exec_command(trans, command): chan = trans.open_session() chan.exec_command(command) stdin = chan.makefile('wb') stdout = chan.makefile('rb') stderr = chan.makefi

RE: [XML-SIG] SAX characters() output on multiple lines for non-ascii

2008-02-02 Thread Brian Smith
> def characters(self, chars): > > newchars=[] > newchars.append(chars.encode('ISO-8859-1')) The SAX parser calls characters() multiple times for the same text block. For example, in the input 123, characters() could be called once: handler.characters("123") or twice:

Re: fast method accessing large, simple structured data

2008-02-02 Thread M.-A. Lemburg
On 2008-02-02 21:36, agc wrote: > Hi, > > I'm looking for a fast way of accessing some simple (structured) data. > > The data is like this: > Approx 6 - 10 GB simple XML files with the only elements > I really care about are the and ones. > > So what I'm hoping to do is put this data in a form

Re: fast method accessing large, simple structured data

2008-02-02 Thread John Machin
agc wrote: > Hi, > > I'm looking for a fast way of accessing some simple (structured) data. > > The data is like this: > Approx 6 - 10 GB simple XML files with the only elements > I really care about are the and ones. > > So what I'm hoping to do is put this data in a format so > that I can ac

Re: dict comprehension

2008-02-02 Thread bearophileHUGS
Steven Bethard: > It also doesn't build the unnecessary intermediate tuples: I see, but can't the interpreter improved to remove similar intermediate tuples anyway? Is this a difficult thing to do? Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: fast method accessing large, simple structured data

2008-02-02 Thread Diez B. Roggisch
agc schrieb: > Hi, > > I'm looking for a fast way of accessing some simple (structured) data. > > The data is like this: > Approx 6 - 10 GB simple XML files with the only elements > I really care about are the and ones. > > So what I'm hoping to do is put this data in a format so > that I can

fast method accessing large, simple structured data

2008-02-02 Thread agc
Hi, I'm looking for a fast way of accessing some simple (structured) data. The data is like this: Approx 6 - 10 GB simple XML files with the only elements I really care about are the and ones. So what I'm hoping to do is put this data in a format so that I can access it as fast as possible for

Re: What should I use under *nix instead of freeze?

2008-02-02 Thread Martin v. Löwis
>>> That being the case, what is the preferred/best replacement for freeze >>> on a *nix platform? >> >> I don't think that there is one, or that there should be one. >> > > So haven't I understood what freeze does? Isn't pyinstaller just that? No. First, it works on Windows, Linux and Irix only,

Re: python for a matlab user

2008-02-02 Thread Jaap Spies
David Wang wrote: > hello python users, > > i use matlab in my daily research and some shell scripting as well > (primarily for data analysis). i wonder how easy or difficult for a > matlab user to pick up python? i also know Fortran but haven't used it > for years. > > thanks for your comments,

Re: functools possibilities

2008-02-02 Thread castironpi
On Feb 2, 12:13 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > 1. functools.partialpre: partialpre( f, x, y )( z )-> f( z, x, y ) > > 2. functools.pare: pare( f, 1 )( x, y )-> f( y ) > > 3. functools.parepre: parepre( f, 1 )( x, y )-> f( x ) > > 4. functools.calling_de

Re: too long float

2008-02-02 Thread Grant Edwards
On 2008-02-02, Steve Holden <[EMAIL PROTECTED]> wrote: >> Apparently you don't know the first thing about floating point >> numbers. I suggest reading the wikipedia entry. >> http://en.wikipedia/wiki/floating_point > > Don't think you are the first person to make this mistake, by the way. > Despi

Re: Linux Journal Survey

2008-02-02 Thread Steve Holden
Albert van der Horst wrote: > In article <[EMAIL PROTECTED]>, > Russ P. <[EMAIL PROTECTED]> wrote: >> On Jan 23, 7:42 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >>> On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: >>> The annual Linux Journal survey is online now for any Linux users who wan

Re: too long float

2008-02-02 Thread Steve Holden
Albert van der Horst wrote: > In article <[EMAIL PROTECTED]>, > Bart Ogryczak <[EMAIL PROTECTED]> wrote: >> On 2008-01-18, citizen J. Peng testified: >>> hello, >>> >>> why this happened on my python? >> a=3.9 >> a >>> 3.8999 > a = 3.9 > print a >> 3.9 > > This has not

Re: functools possibilities

2008-02-02 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > 1. functools.partialpre: partialpre( f, x, y )( z )-> f( z, x, y ) > 2. functools.pare: pare( f, 1 )( x, y )-> f( y ) > 3. functools.parepre: parepre( f, 1 )( x, y )-> f( x ) > 4. functools.calling_default: calling_default( f, a, DefaultA, b )-> > f( a, , b ) There are l

Re: dict comprehension

2008-02-02 Thread Steven Bethard
Wildemar Wildenburger wrote: > Arnaud Delobelle wrote: >>> I believe both set and dict comprehensions will be in 3.0. >> >> Python 3.0a1+ (py3k:59330, Dec 4 2007, 18:44:39) >> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >>

Re: python for a matlab user

2008-02-02 Thread Ken Dere
David Wang wrote: > hello python users, > > i use matlab in my daily research and some shell scripting as well > (primarily for data analysis). i wonder how easy or difficult for a > matlab user to pick up python? i also know Fortran but haven't used it > for years. > > thanks for your comments,

Re: Naive idiom questions

2008-02-02 Thread kdwyer
On Jan 31, 9:30 pm, Terran Melconian <[EMAIL PROTECTED]> wrote: > > I want to be able to accumulate a string with +=, not by going > through an intermediate list and then doing ''.join(), because I > think the latter is ugly. As others have observed, you can build a string using += ins

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-02 Thread Ken Dere
Blubaugh, David A. wrote: > To All, > > > I have been evaluating the python environment ever more closer. I > believe I can interface python with a development environment known as > the ImpulseC environment. The ImpulseC environment develops C to VHDL > for FPGA development. I would espec

Re: bags? 2.5.x?

2008-02-02 Thread Carsten Haese
On Sat, 2008-02-02 at 01:17 -0800, Paul Rubin wrote: > Arnaud Delobelle <[EMAIL PROTECTED]> writes: > > * For sets {x, y} union {y, z} = {x, y, z}. The natural way of > > extending this to multisets is having the union operator take the > > max of the multiplicities of each element, i.e. > >

Re: Linux Journal Survey

2008-02-02 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, Russ P. <[EMAIL PROTECTED]> wrote: >On Jan 23, 7:42 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: >> >> > The annual Linux Journal survey is online now for any Linux users who >> > want to vote for Python. http://www.li

Re: too long float

2008-02-02 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, Bart Ogryczak <[EMAIL PROTECTED]> wrote: >On 2008-01-18, citizen J. Peng testified: >> hello, >> >> why this happened on my python? > > a=3.9 > a >> 3.8999 > a = 3.9 print a >3.9 This has nothing to do with python. Apparently you don'

Re: Python Standardization: Wikipedia entry

2008-02-02 Thread Eduardo O. Padoan
On Jan 29, 2008 2:43 PM, John Nagle <[EMAIL PROTECTED]> wrote: >Submitting Python 2.5 to ISO/ANSI might be a good idea. >From GvR himself: """ - Does a specification (ISO, ECMA, ..) is planned for Python and when ? No, never. I don't see the point. """ http://blogs.nuxeo.com/sections/blogs/ta

Re: string split without consumption

2008-02-02 Thread robert
Steve Holden wrote: > robert wrote: > [...] >> but its also wrong regarding partial last lines. >> >> re.split obviously doesn't understand \A \Z ^ $ and also \b etc. empty >> matches. >> > [...] > Or perhaps you don't understand re? > > It's a tricky thing to start playing with. Look up re.MULTI

python for a matlab user

2008-02-02 Thread David Wang
hello python users, i use matlab in my daily research and some shell scripting as well (primarily for data analysis). i wonder how easy or difficult for a matlab user to pick up python? i also know Fortran but haven't used it for years. thanks for your comments, d. -- http://mail.python.org/mai

Re: Mysterious xml.sax Encoding Exception

2008-02-02 Thread Stefan Behnel
Hi, Peck, Jon top-posted: >> Stefan Behnel wrote: >> No. The internal representation of unicode characters is platform >> dependent, and is either 2 or 4 bytes per character. If you want UTF-16, >> use ".encode()". > > Thanks. The two users having the problem are on Windows, so I think Python >

Re: How to convert markup text to plain text in python?

2008-02-02 Thread Zentrader
On Feb 1, 8:07 am, geoffbache <[EMAIL PROTECTED]> wrote: > I have some marked up text and would like to convert it to plain text, If this is just a quick and dirty problem, you can also use one of the lynx/elinks/links2 browsers and dump the contents to a file. On Linux it would be lynx -dump htt

Re: string split without consumption

2008-02-02 Thread Steve Holden
robert wrote: [...] > but its also wrong regarding partial last lines. > > re.split obviously doesn't understand \A \Z ^ $ and also \b etc. > empty matches. > [...] Or perhaps you don't understand re? It's a tricky thing to start playing with. Look up re.MULTILINE ans re.DOTALL. regards Ste

Re: string split without consumption

2008-02-02 Thread robert
Jeffrey Froman wrote: > robert wrote: > >> thanks. Yet this does not work "naturally" consistent in my line >> processing algorithm - the further buffering. Compare e.g. >> ss.split('\n') .. >> > 'owi\nweoifj\nfheu\n'.split('\n') >> ['owi', 'weoifj', 'fheu', ''] > 'owi\nweoifj\nfheu\nxx'.

Re: Mysterious xml.sax Encoding Exception

2008-02-02 Thread Stefan Behnel
Peck, Jon schrieb: > Yes, the characters were from the 0-127 ascii block but encoded as utf-16, so > there is a null byte with each nonzero character. I.e., > \x00?\x00x\x00m\x00l\x00 > > Here is something weird I found while experimenting with ElementTree with > this same XML string. > > Con

Re: string split without consumption

2008-02-02 Thread robert
Tim Chase wrote: this didn't work elegantly as expected: >>> ss 'owi\nweoifj\nfheu\n' >>> re.split(r'(?m)$',ss) ['owi\nweoifj\nfheu\n'] >>> Do you have a need to use a regexp? >> I'd like the general case - split without consumption. > > I'm not sure there's a one-p

Re: string split without consumption

2008-02-02 Thread Jeffrey Froman
robert wrote: > thanks. Yet this does not work "naturally" consistent in my line > processing algorithm - the further buffering. Compare e.g. > ss.split('\n')  .. > > >>> 'owi\nweoifj\nfheu\n'.split('\n') > ['owi', 'weoifj', 'fheu', ''] > >>> 'owi\nweoifj\nfheu\nxx'.split('\n') > ['owi', 'weoifj'

RE: Mysterious xml.sax Encoding Exception

2008-02-02 Thread Peck, Jon
Yes, the characters were from the 0-127 ascii block but encoded as utf-16, so there is a null byte with each nonzero character. I.e., \x00?\x00x\x00m\x00l\x00 Here is something weird I found while experimenting with ElementTree with this same XML string. Consider the same XML as a Python Unic

Re: What should I use under *nix instead of freeze?

2008-02-02 Thread Thorsten Kampe
* Wildemar Wildenburger (Sat, 02 Feb 2008 01:39:05 +0100) > Mike Kent wrote: > > That being the case, what is the preferred/best replacement for > > freeze on a *nix platform? > > Don't know about best or preferred, but pyinstaller seems to do > that. http://pyinstaller.python-hosting.com> Doesn'

Re: string split without consumption

2008-02-02 Thread Tim Chase
>>> this didn't work elegantly as expected: >>> >>> >>> ss >>> 'owi\nweoifj\nfheu\n' >>> >>> re.split(r'(?m)$',ss) >>> ['owi\nweoifj\nfheu\n'] >> Do you have a need to use a regexp? > > I'd like the general case - split without consumption. I'm not sure there's a one-pass regex solution to the

Re: Win32 python: odd behavior when run via ssh

2008-02-02 Thread Thorsten Kampe
* Gabriel Genellina (Fri, 01 Feb 2008 23:13:27 -0200) > En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge > <[EMAIL PROTECTED]> escribió: > > If you're using the offficial Win32 port of Python than you > > probably want to use the Cygwin version because Win32 version > > doesn't support readline any

Re: xmlrpclib, testing server presence

2008-02-02 Thread Trevor Hennion
On Sat, 02 Feb 2008 00:22:15 -0800, rocco.rossi wrote: > I'm employing xmlrpclib for a project at work, and I must say that I'm > quite impressed with its effectiveness and ease of use. > > However, I was recently doing some tests when I realized that if the > server was down, the client quite si

Re: bags? 2.5.x?

2008-02-02 Thread MRAB
On Feb 2, 9:17 am, Paul Rubin wrote: > Arnaud Delobelle <[EMAIL PROTECTED]> writes: > > * For sets {x, y} union {y, z} = {x, y, z}. The natural way of > > extending this to multisets is having the union operator take the > > max of the multiplicities of each element,

Re: string split without consumption

2008-02-02 Thread robert
Tim Chase wrote: >> this didn't work elegantly as expected: >> >> >>> ss >> 'owi\nweoifj\nfheu\n' >> >>> re.split(r'(?m)$',ss) >> ['owi\nweoifj\nfheu\n'] > > Do you have a need to use a regexp? I'd like the general case - split without consumption. > ss.splitlines(True) > ['owi\n', 'weoi

Re: Sorting Large File (Code/Performance)

2008-02-02 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> Thanks to all who replied. It's very appreciated. >> >> Yes, I had to double check line counts and the number of lines is ~16 >> million (instead of stated 1.6B). > >OK, that's not bad at all. >

Re: urllib supports javascript

2008-02-02 Thread M��ta-MCI (MVP)
Hi! "javascript support" need more details: - only the (abstract) language? - or, also, visuals aspects? On Windows, you can use,easily, the language (JScript). Example: import win32com.client js=win32com.client.Dispatch('ScriptControl') js.language='jscript' src="""function jmul2(x){

Re: REALLY simple xml reader

2008-02-02 Thread Stefan Behnel
Steven D'Aprano wrote: > On Fri, 01 Feb 2008 07:51:56 +1100, Ben Finney wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>> On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: >>> Quite apart from a human thinking it's pretty or not pretty, it's *not valid XML* if the XML de

Re: Sorting Large File (Code/Performance)

2008-02-02 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Thanks to all who replied. It's very appreciated. > >Yes, I had to doublecheck line counts and the number of lines is ~16 >million (insetead of stated 1.6B). > >Also: > >>What is a "Unicode text file"? How is it encoded: utf8, utf16, utf1

Re: What does % mean/does in this context?

2008-02-02 Thread Tim Chase
> for item in cart.values(): > v = _button_cart % {"idx": idx, > "itemname": item.name, > "amount": item.cost, > "quantity": item.quantity,} > cartitems.append(v) > > > What d

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-02 Thread Dotan Cohen
On 01/02/2008, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > To Everyone on the planet Earth, > > > Please accept my apologies for > > Why the Hell has nobody answered my question. > > > I am just trying to finish a Masters thesis that is quite beyond > anything in this wo

What does % mean/does in this context?

2008-02-02 Thread Marcelo de Moraes Serpa
Take the following piece of code: for item in cart.values(): v = _button_cart % {"idx": idx, "itemname": item.name, "amount": item.cost, "quantity": item.quantity,} cartitems.a

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-02 Thread Danyelle Gragsone
Well, If people are intentionally ignoring you.. can't do much about it. Yelling just makes them laugh and ignore you more. It is a public forum. People are not obligated to answer your question. Most people if they don't know an answer to your question.. will just not answer. Could you imagine

Re: string split without consumption

2008-02-02 Thread Tim Chase
> this didn't work elegantly as expected: > > >>> ss > 'owi\nweoifj\nfheu\n' > >>> re.split(r'(?m)$',ss) > ['owi\nweoifj\nfheu\n'] Do you have a need to use a regexp? >>> ss.splitlines(True) ['owi\n', 'weoifj\n', 'fheu\n'] -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: What should I use under *nix instead of freeze?

2008-02-02 Thread Wildemar Wildenburger
Martin v. Löwis wrote: >> That being the case, what is the preferred/best replacement for freeze >> on a *nix platform? > > I don't think that there is one, or that there should be one. > So haven't I understood what freeze does? Isn't pyinstaller just that? /W -- http://mail.python.org/mailma

Re: REALLY simple xml reader

2008-02-02 Thread Steven D'Aprano
On Fri, 01 Feb 2008 07:51:56 +1100, Ben Finney wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: >> >> > Quite apart from a human thinking it's pretty or not pretty, it's >> > *not valid XML* if the XML declaration isn't immediately a

string split without consumption

2008-02-02 Thread robert
this didn't work elegantly as expected: >>> ss 'owi\nweoifj\nfheu\n' >>> re.split(r'\A',ss) ['owi\nweoifj\nfheu\n'] >>> re.split(r'\Z',ss) ['owi\nweoifj\nfheu\n'] >>> re.split(r'$',ss) ['owi\nweoifj\nfheu\n'] >>> re.split(r'(?s)$',ss) ['owi\nweoifj\nfheu\n'] >>> re.split(r'(?m)(?s)$',ss) ['o

Re: Urllib keyerror, confused

2008-02-02 Thread Navtej Singh
possibly the server did not sent the 'Content-Length' header. On Feb 2, 2008 5:18 PM, Adam W. <[EMAIL PROTECTED]> wrote: > I took this script: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/83208 > And decided to try it out, it works when I first download a file, and > when I try to re

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-02 Thread js
And why the HELL people prefer answering this kind of question to normal ones? (Including me...) On Jan 31, 2008 9:40 AM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > I do not understand why no one has answered the following question: > > Has anybody worked with Gene Expression Programming

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-02 Thread Dotan Cohen
On 31/01/2008, Shane Geiger <[EMAIL PROTECTED]> wrote: > The answer is here: > http://www.google.com/search?q=gene+expression+programming+python > Not anymore. Now, that page is all links to this thread! Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-

Urllib keyerror, confused

2008-02-02 Thread Adam W.
I took this script: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/83208 And decided to try it out, it works when I first download a file, and when I try to resume a downloaded file, but if the file is already downloaded, and I expect to see the print "File already downloaded" message com

Re: Strange sqlite3 library behavior

2008-02-02 Thread Guilherme Polo
2008/2/2, Roel Schroeven <[EMAIL PROTECTED]>: > Victor Lin schreef: > > > Now I am now developing a program that base on sqlite3 in python. > > But there is a strange problem. > > That is, all data I insert into sqlite database do not goes into file > > in disk. > > It is really strange >

Re: Strange sqlite3 library behavior

2008-02-02 Thread Roel Schroeven
Victor Lin schreef: > Now I am now developing a program that base on sqlite3 in python. > But there is a strange problem. > That is, all data I insert into sqlite database do not goes into file > in disk. > It is really strange > Why do these data just keep in memory and discarded? sqlite3 wor

Strange sqlite3 library behavior

2008-02-02 Thread Victor Lin
Now I am now developing a program that base on sqlite3 in python. But there is a strange problem. That is, all data I insert into sqlite database do not goes into file in disk. It is really strange Why do these data just keep in memory and discarded? All things that really store in file is the

Re: REALLY simple xml reader

2008-02-02 Thread Steven D'Aprano
On Sat, 02 Feb 2008 07:24:36 +0100, Stefan Behnel wrote: > Steven D'Aprano wrote: >> The same way it knows that "> encoding. If the parser knows that the hex bytes >> >> 3c 3f 78 6d 6c >> >> (or 3c 00 3f 00 78 00 6d 00 6c 00 if you prefer UTF-16, and feel free >> to swap the byte order) >> >> m

Re: Mysterious xml.sax Encoding Exception

2008-02-02 Thread John Machin
On Feb 2, 8:12 am, JKPeck <[EMAIL PROTECTED]> wrote: > On Feb 1, 1:51 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > They sent me the actual file, which was created on Windows, as an > > > email attachment. They had also sent the actual dataset from which > > > the XML was generated so

Re: bags? 2.5.x?

2008-02-02 Thread Paul Rubin
Arnaud Delobelle <[EMAIL PROTECTED]> writes: > * For sets {x, y} union {y, z} = {x, y, z}. The natural way of > extending this to multisets is having the union operator take the > max of the multiplicities of each element, i.e. That certainly doesn't fit the intuition of a bag of objects. I'

Re: bags? 2.5.x?

2008-02-02 Thread Arnaud Delobelle
On Feb 1, 10:29 pm, Paul Rubin wrote: > Dan Stromberg <[EMAIL PROTECTED]> writes: > > > * Is the feature useful for the broad mass? > > > Yes, probably, at least if this kind of feature's inclusion in other > > languages and my two recent needs for it are any indication.

xmlrpclib, testing server presence

2008-02-02 Thread rocco . rossi
I'm employing xmlrpclib for a project at work, and I must say that I'm quite impressed with its effectiveness and ease of use. However, I was recently doing some tests when I realized that if the server was down, the client quite simply hanged (no use of "try ... except" here) with no error or tra