Re: Integer From A Float List?!?

2005-03-04 Thread Peter Otten
Nick Coghlan wrote: > C:\>python -m timeit -s "floats = map(float, range(1000))" "ints = > map(int, floa ts)" > 1000 loops, best of 3: 481 usec per loop > > C:\>python -m timeit -s "floats = map(float, range(1000))" "ints = [int(x) > for x in floats]" > 1000 loops, best of 3: 721 usec per loop >

Re: Making things more functional in Python

2005-03-04 Thread Dave Benjamin
On Sat, 2005-03-05 at 00:00 -0700, Dave Benjamin wrote: > On Fri, 2005-03-04 at 08:36 -0800, gf gf wrote: > > Is there a better, more FP style, more Pythonic way to > > write this: > > > > def compute_vectors(samples, dset): > > vectors = {} > > for d in dset: > > vectors[d] =

Re: Making things more functional in Python

2005-03-04 Thread Dave Benjamin
On Fri, 2005-03-04 at 08:36 -0800, gf gf wrote: > Is there a better, more FP style, more Pythonic way to > write this: > > def compute_vectors(samples, dset): > vectors = {} > for d in dset: > vectors[d] = [sample.get_val(d) for sample in > samples] > return vectors

Re: Question of speed - Flat file DBMS

2005-03-04 Thread John Machin
I.V. Aprameya Rao wrote: > Hi > > I have to implement a flat file dbms. The basic condition is that > relations will be given in files and i will have to run certain select > project join queries on those relations. > > Can someone tell me as to which language will be faster, python or C++?? Fast

locale support and 4.10

2005-03-04 Thread Timothy Smith
i'm trying to setlocale() on 4.10, and it appears the python package doesn't support this under 4.10. Python 2.3.3 (#2, Apr 28 2004, 22:48:37) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(

Question of speed - Flat file DBMS

2005-03-04 Thread I.V. Aprameya Rao
Hi I have to implement a flat file dbms. The basic condition is that relations will be given in files and i will have to run certain select project join queries on those relations. Can someone tell me as to which language will be faster, python or C++?? Aprameya -- http://mail.python.org/ma

Re: Newbie getting confused again

2005-03-04 Thread It's me
*bonk, bonk, bonk* Now I feel better. Thanks, everybody. The "+" is indeed what I was looking for.It just didn't occur to me that this is the way you concatenate two lists together. But of course, that makes sense, doesn't it? Thanks again. "Peter Hansen" <[EMAIL PROTECTED]> wrote in mes

Re: Integer From A Float List?!?

2005-03-04 Thread Nick Coghlan
Bill Mill wrote: You're going to have to use loops. I don't know how Matlab can do it without them, unless it maintains the matrix as a list of floats and simply *views* it as a list of ints. More likely, it simply hides the loop away from you. Anyway, here's some ways to do it: preferable: int_mat

io.h include file in pyconfig.h

2005-03-04 Thread pythonnewbie
I am trying to rebuild a rpm that was implemented in the python language. I installed the python package 2.3.3 from Suse 9.1 Linux CD. I got the following error when rebuilding the rpm, /usr/Python-2.3.3/Include/pyconfig.h:30:16: io.h: No such file or directory where I should find the correct "io

Re: [announcement] - python graph library

2005-03-04 Thread Harlin Seritt
"Maxim Khesin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Folks, > I recently started working on a graph-algorithms library in Python. What > makes this one different from the other couple of libs that are > available is a heavy influence from the C++ Boost Graph Library.

Re: programmatically calling a function

2005-03-04 Thread Peter Hansen
Dave Ekhaus wrote: i'd like to call a python function programmatically - when all i have is the functions name as a string. i.e. > fnames = ['foo', 'bar'] The usual answer at this point is to say that functions are "first class objects" in Python, which basically means you can haul around ref

Re: Newbie getting confused again

2005-03-04 Thread Peter Hansen
Peter Hansen wrote: It's me wrote: If I have: a = (1,2,3) Note that this is a tuple. how do I ended up with: res=[(1), (2), (3), (4), (5)] Not that this is a list. The two aren't the same thing. I meant to say "Note" here, not "Not"... in case it wasn't obvious. -Peter -- http://m

Re: Newbie getting confused again

2005-03-04 Thread Peter Hansen
It's me wrote: If I have: a = (1,2,3) Note that this is a tuple. how do I ended up with: res=[(1), (2), (3), (4), (5)] Not that this is a list. The two aren't the same thing. If you don't understand the difference, you might want to review the tutorial or head over to the tutor list. Also

Re: survey

2005-03-04 Thread Peter Hansen
Dave Zhu wrote: Hello All, Is there any survey on scripting languages? I would like to get information on several scripting languages including Python, Perl, Ruby, Tcl, etc. What kind of information? ... -- http://mail.python.org/mailman/listinfo/python-list

programmatically calling a function

2005-03-04 Thread Dave Ekhaus
hi i'd like to call a python function programmatically - when all i have is the functions name as a string. i.e. fnames = ['foo', 'bar'] for func in fnames: # # how do i call function 'func' when all i have is the name of the function ??? # def foo(): print 'foo

Re: windows bat file question

2005-03-04 Thread Peter Hansen
Duncan Booth wrote: Peter Hansen wrote: Unfortunately, Google makes it hard to search for such things, but after a while I was able to dig up this master reference: http://www.microsoft.com/resources/documentation/windows/xp/all/proddoc s/en-us/percent.mspx You will find even more information if y

Re: Newbie getting confused again

2005-03-04 Thread John Machin
It's me wrote: > If I have: > > a = (1,2,3) > > how do I ended up with: > > res=[(1), (2), (3), (4), (5)] > > without doing: > > res=[(a[0]), (a[1]), (a[2]), (4), (5)] > If by (x) you really mean a tuple with 1 element i.e. (x,) then you need something like this: >>> a = (1, 2, 3) >>

Re: Python 2.4 removes None data type?

2005-03-04 Thread John Machin
[EMAIL PROTECTED] wrote: > I just read in the 'What's New in Python 2.4' document that the None > data type was converted to a constant: > http://python.org/doc/2.4/whatsnew/node15.html > > """ > # None is now a constant; code that binds a new value to the name > "None" is now a syntax error. > ""

Newbie getting confused again

2005-03-04 Thread It's me
If I have: a = (1,2,3) how do I ended up with: res=[(1), (2), (3), (4), (5)] without doing: res=[(a[0]), (a[1]), (a[2]), (4), (5)] ??? ps: This is just a nobrainer example of what my real code is trying to do. "a" might have many many elements. That's why the explicit indexing

Re: Fast 2d brown/pink noise generation?

2005-03-04 Thread Robert Kern
Mathias wrote: Dear NG, I'm looking for a fast way to produce 2d-noise images with 1/f or 1/f^2 spectrum. I currently generate the noise via inverse FFT, but since I need lots of data (~10^7 for a monte carlo simulation) it needs to be really fast. Does someone know a faster way than my approach

Another math problem...

2005-03-04 Thread qwweeeit
Another math problem easier to solve by hand, but, IMHO, difficult to program in a concise way like the solution of Bill Mill (linalg_brute.py) to the problem of engsol. I appreciated very much the Bill Mill's solution and that inspired in a certain way the solution for my problem. # Problem and

Re: Integer From A Float List?!?

2005-03-04 Thread George Sakkis
"Bill Mill" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 4 Mar 2005 22:35:48 +0100, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > Hello NG, > > > > I was wondering if there is a way to obtain, from a list of floats, > > a list of integers without loops. Probably i

Re: urllib2 meta-refresh

2005-03-04 Thread John J. Lee
JanC <[EMAIL PROTECTED]> writes: > Artificial Life schreef: > > > urllib2 does not seem to be able to handle META-REFRESH in an html > > document. I just get back the html to the page that is supposed to > > forward me to the intended page. Any way around this? > > Have a look at the HTTPRefres

Re: Ruby on Rails or Perl's Maypole..is there a Python equivalent

2005-03-04 Thread John J. Lee
Gary Nutbeam <[EMAIL PROTECTED]> writes: > D H wrote: [...] > > Check out Castle on Rails for .NET/Mono. It is still in early > > development, but you can use it with C#, VB, or boo, and I'm sure > > eventually with IronPython as well. > > Thanks for the feedback. I should have been more specific

Re: survey

2005-03-04 Thread Alan Gauld
On Fri, 4 Mar 2005 14:14:05 -0800 (PST), Dave Zhu <[EMAIL PROTECTED]> wrote: > Is there any survey on scripting languages? I would > like to get information on several scripting languages > including Python, Perl, Ruby, Tcl, etc. There are several such comparisons on the web but most will natural

Re: enum question

2005-03-04 Thread Larry Bates
Not completely sure I understand (my C is weak). But you can do: x=range(9) x's contents will be [0,1,2,3,4,5,6,7,8] or x=range(12,25) x's conetnst will be [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] if you mean a way to limit x's contents to a predefined list of values, you need to

Re: Explicit or general importing of namespaces?

2005-03-04 Thread Harlin Seritt
I think the bottom line on this is using your own sense of risk/reward with each given module imported. Some modules (Tkinter comes to mind) it makes sense to pollute while others it doesn't. Harlin "Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Peter Mayne wrote:

Re: windows bat file question

2005-03-04 Thread Alan Gauld
On 4 Mar 2005 10:18:08 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > You will find even more information if you try 'set /?' or 'for /?' at a > command prompt. As you say, you can now do quite complicated scripting in > command files but it needs masochism second only to Perl programming. And u

Re: tkinter entry eat chars?

2005-03-04 Thread Harlin Seritt
You can use the textvariable option for the Entry widget. Set a bind event for this widget that when any key pressed the StringVar() will be polled via StringVar().get(). You do some checking for certain chars you don't want entered and then delete them as they occur. Harlin "phil" <[EMAIL PROTEC

Re: survey

2005-03-04 Thread George Sakkis
"Dave Zhu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello All, > > Is there any survey on scripting languages? I would > like to get information on several scripting languages > including Python, Perl, Ruby, Tcl, etc. > > Thanks > > Dave After a little googling, that's what I

Re: creating .NET clients with python

2005-03-04 Thread John J. Lee
Guy Robinson <[EMAIL PROTECTED]> writes: > Can anyone confirm if there is a python library that can allow me to > create .NET clients in python. > > My understanding is both IronPython and python for .NET can't create > python .net clients? IIUC, IronPython can, but it's not ready for production

Re: Python 2.4 removes None data type?

2005-03-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I just read in the 'What's New in Python 2.4' document that the None > data type was converted to a constant: > http://python.org/doc/2.4/whatsnew/node15.html > > """ > # None is now a constant; code that binds a ne

Re: Python 2.4 removes None data type?

2005-03-04 Thread Michael Hoffman
Warren Postma wrote: Implication: A long standing wart in Python now gone. Its time to gloat. Are there any really evil glitches LEFT in Python? Now go look at Perl and come back and say "Thank-deity-of-my-choice-I'm-using-Python". The fact that True and False are not constants? -- Michael Hoffm

Re: Indexing strings

2005-03-04 Thread Fred
> Use the index method, e.g.: text.index(' '). > What exactly do you want to do? That was exactely what I was searching for. I needed a program, that chopped up a string into its words and then saves them into a list. I think I got this done... Thanks for the help -- http://mail.python.org/mailma

Re: Python 2.4 removes None data type?

2005-03-04 Thread Steve Holden
Warren Postma wrote: [EMAIL PROTECTED] wrote: I just read in the 'What's New in Python 2.4' document that the None data type was converted to a constant: http://python.org/doc/2.4/whatsnew/node15.html Implication: A long standing wart in Python now gone. Its time to gloat. Are there any really e

Re: Gordon McMillan installer and Python 2.4

2005-03-04 Thread David Bolen
[EMAIL PROTECTED] (Svein Brekke) writes: > Has anyone else succeded in using McMillans installer on 2.4? > Thanks for any help. I have a feeling that it may be related to the fact that the starter modules (run*.exe) were built with VC6, which matches with Python builds up to 2.3, but not 2.4 (whi

Re: Indexing strings

2005-03-04 Thread Steve Holden
Fred wrote: Hi everybody I am searching for a possibility, to find out, what the index for a certain lettyer in a string is. My example: for x in text: if x == ' ': list = text[: # There I need the index of the space the program found during the loop... Is there and possibility to fin

Re: Indexing strings

2005-03-04 Thread Patrick Useldinger
Fred wrote: I am searching for a possibility, to find out, what the index for a certain lettyer in a string is. My example: for x in text: if x == ' ': list = text[: # There I need the index of the space the program found during the loop... Is there and possibility to find the index o

Re: Problem with variabels in Tkinter

2005-03-04 Thread Steve Holden
Svennglenn wrote: I have a problem with a program i'm making in Tkinter. The code is avaliable at: http://paste.plone.org/943 When i'm running the program and enters a value and press the button in the dialog window that comes up when a press the button "Lägg till spelare" (add a player in swedish)

Re: get textual content of a Xml element using 4DOM

2005-03-04 Thread Frank Abel Cancio Bello
Hi: PrettyPrint or Print return the value to the console, and i need keep this value in a string variable to work with it, how can i do this? thanks to Uche Frank Abel -Original Message- From: [EMAIL PROTECTED] To: python-list@python.org Date: 4 Mar 2005 09:23:07 -0800 Subject: Re: get

Indexing strings

2005-03-04 Thread Fred
Hi everybody I am searching for a possibility, to find out, what the index for a certain lettyer in a string is. My example: for x in text: if x == ' ': list = text[: # There I need the index of the space the program found during the loop... Is there and possibility to find the ind

Re: Python 2.4 removes None data type?

2005-03-04 Thread Warren Postma
[EMAIL PROTECTED] wrote: I just read in the 'What's New in Python 2.4' document that the None data type was converted to a constant: http://python.org/doc/2.4/whatsnew/node15.html Implication: A long standing wart in Python now gone. Its time to gloat. Are there any really evil glitches LEFT in P

survey

2005-03-04 Thread Dave Zhu
Hello All, Is there any survey on scripting languages? I would like to get information on several scripting languages including Python, Perl, Ruby, Tcl, etc. Thanks Dave __ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 M

Re: Suspicious header

2005-03-04 Thread James Stroud
This was happening to me for a while but stopped. I think it has to do with your mail server. Perhaps you could find another. If you are at a company, you might want to talk to your sysadmin and see if he can change the mail program. How did you get this latest message through? You know, with th

Re: Python 2.4 removes None data type?

2005-03-04 Thread Gary D. Duzan
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >I just read in the 'What's New in Python 2.4' document that the None >data type was converted to a constant: >http://python.org/doc/2.4/whatsnew/node15.html > >""" ># None is now a constant; code that binds a new valu

Re: Python 2.4 removes None data type?

2005-03-04 Thread Tim Peters
[EMAIL PROTECTED] > I just read in the 'What's New in Python 2.4' document that the None > data type was converted to a constant: > http://python.org/doc/2.4/whatsnew/node15.html > > """ > # None is now a constant; code that binds a new value to the name > "None" is now a syntax error. > """ > > S

Suspicious header

2005-03-04 Thread phil
everything I post to this list bounces awaiting moderator approval, due to suspicious header. COuld someone tell me what's wrong. I'm on lots of list with no problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: Integer From A Float List?!?

2005-03-04 Thread Bill Mill
On Fri, 4 Mar 2005 22:35:48 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello NG, > > I was wondering if there is a way to obtain, from a list of floats, > a list of integers without loops. Probably is a basic question, but I can't > find an answer... I have had my eyes blinded by Ma

Python 2.4 removes None data type?

2005-03-04 Thread [EMAIL PROTECTED]
I just read in the 'What's New in Python 2.4' document that the None data type was converted to a constant: http://python.org/doc/2.4/whatsnew/node15.html """ # None is now a constant; code that binds a new value to the name "None" is now a syntax error. """ So, what's the implications of this?

Integer From A Float List?!?

2005-03-04 Thread andrea_gavana
Hello NG, I was wondering if there is a way to obtain, from a list of floats, a list of integers without loops. Probably is a basic question, but I can't find an answer... I have had my eyes blinded by Matlab for years, but now that I discovered Python+wxPython there seems to be no limit on wh

Problem with variabels in Tkinter

2005-03-04 Thread Svennglenn
I have a problem with a program i'm making in Tkinter. The code is avaliable at: http://paste.plone.org/943 When i'm running the program and enters a value and press the button in the dialog window that comes up when a press the button "Lägg till spelare" (add a player in swedish) I get this error

Re: winnt win32process.createProcess with stdout to file ?

2005-03-04 Thread Roger Upole
TerminateProcess doesn't give it a chance to exit normally and do any cleanup that would happen if it exited itself. It may not have been able to flush its file buffers, etc. Does the executable have any way to signal it to exit ? Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL

Re: win32 COM and data types / direction

2005-03-04 Thread Thomas Heller
Alexander Eisenhuth <[EMAIL PROTECTED]> writes: > Hello everybody, > > i wonder how the win32 COM extension handles different C-int types > (short, int, long). Another question for me is weather the > "out-direction" of parameter is supported "out of the box" ? > > To clarify look at the methode "

Re: Communication between python scripts

2005-03-04 Thread [EMAIL PROTECTED]
Another reason NOT to use XML-RPC: PSF-2005-001 - SimpleXMLRPCServer.py allows unrestricted traversal http://python.org/security/PSF-2005-001/ -- http://mail.python.org/mailman/listinfo/python-list

enum question

2005-03-04 Thread M.N.A.Smadi
does python support a C-like enum statement where one can define a variable with prespesified range of values? thanks m.smadi -- http://mail.python.org/mailman/listinfo/python-list

Re: [Numeric] column vector faster than row vector in mat multiply?

2005-03-04 Thread Terry Reedy
"Zhang Le" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I did a small benchmark of matrix-vector multiply operation using > Numeric module. I'm a bit suprised to find matrix*col-vector is much > faster than row-vector*matrix. I wonder whether other people have > observed t

Re: __contains__ inconsistencies between Python 2.2 and 2.3

2005-03-04 Thread Steve Holden
Anand S Bisen wrote: Hello I have been developing a code that works pretty well on my python 2.3 and now when i am running it on my server where it is programmed to run it's giving me errors. I have been using __contains__ method and it fails on python 2.2 For example (Python 2.3) >> x="Hello

Re: __contains__ inconsistencies between Python 2.2 and 2.3

2005-03-04 Thread Steven Bethard
Anand S Bisen wrote: For example (Python 2.3) >> x="Hello World" >> print x.__contains__("Hello") True (Python 2.2) >>> x="Hello world" >>> print x.__contains__("Hello") Traceback (most recent call last): File "", line 1, in ? TypeError: 'in ' requires character as left operand Is there any wo

__contains__ inconsistencies between Python 2.2 and 2.3

2005-03-04 Thread Anand S Bisen
Hello I have been developing a code that works pretty well on my python 2.3 and now when i am running it on my server where it is programmed to run it's giving me errors. I have been using __contains__ method and it fails on python 2.2 For example (Python 2.3) >> x="Hello World" >> print x.__co

Re: Unable to run IDLE Under Windows

2005-03-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: Peter Otten wrote: Perhaps your configuration files contain bad data: # IDLE reads several config files to determine user preferences. This # file is the default config file for general idle settings. ... # On Windows2000 and Windows XP the .idlerc directory is at # D

Re: greedy match wanted

2005-03-04 Thread alexk
Thanks, I'll try your solution. Alex. -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy way to check modules for python version compatibility?

2005-03-04 Thread [EMAIL PROTECTED]
I do not think there's a direct way of telling it - but you can try to catch a DeprecationWarning, that is issued by most code deprecated modules -- http://mail.python.org/mailman/listinfo/python-list

Q: Module Shared Data

2005-03-04 Thread CatManDo
Disclaimer #1: I am a Python newbie, and I appreciate the vast documentation at python.org -- some of which I expect has the answer to my question if I can find it. I am working on a custom computational fluid dynamics code. I will create one or more compiled Python modules in C/C++ to provide ne

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Max Erickson
you might also want to take a look at http://unxutils.sourceforge.net/ where are the tools are available in a single zip file. max -- http://mail.python.org/mailman/listinfo/python-list

Easy way to check modules for python version compatibility?

2005-03-04 Thread Stephen Toledo-Brown
Given some Python source, is there any tool which can tell the mimimum level of Python required to run that source? If I distribute some code, I need to be able to say which level of Python users require to run it. -- Steve Toledo-Brown Speaking for myself only. Humans please use domain uk.ibm.c

Re: Setting default option values for Tkinter widgets

2005-03-04 Thread Kent Johnson
Steve Holden wrote: [EMAIL PROTECTED] wrote: Eric, your tagline doesn't parse correctly on my Python 2.4 shell. So, are you using Windows? If you interchange single and double quotes it works on Windows too python -c "print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.z^5(17l8(%,5.Z*(93-965$l7+

[Job - Part Time - Local] Seeking Python Coder in South Alabama area.

2005-03-04 Thread John F.
Startup company in Fairhope, AL is seeking a strong python programmer in the Mobile, AL or Eastern Shore, AL area to assist in the development of legal practice management systems. Candidate must reside in the area. Position will be initially part time. Must be proficient with Freebsd/Postgresql/

Re: Unable to run IDLE Under Windows

2005-03-04 Thread maxwell
Peter Otten wrote: > Perhaps your configuration files contain bad data: > > # IDLE reads several config files to determine user preferences. This > # file is the default config file for general idle settings. ... > # On Windows2000 and Windows XP the .idlerc directory is at > # Documents and

Re: Is there way to determine which class a method is bound to?

2005-03-04 Thread Victor Ng
So I went digging through the documentation more and found the following: http://docs.python.org/ref/types.html There's a section titled "User-defined methods" which covers all the im_self, im_class attributes and what they are responsible for. vic On 25 Feb 2005 10:42:06 -0800, [EMAIL PROTECTE

Re: Downloadable python-dev archive February 2005 contains only one mail?

2005-03-04 Thread tlesher
Yes; it seems that the "advance" post by effbot messed up the archiving. If you get http://mail.python.org/pipermail/python-dev/2005-February.txt (without the .gz suffix), you'll get the whole archive. -- http://mail.python.org/mailman/listinfo/python-list

Re: Making things more functional in Python

2005-03-04 Thread Steve Holden
Michael Hoffman wrote: Steve Holden wrote: return dict([(d, sample.getval(d)) for d in dset for sample in samples]) That won't do what the original code does. This sets dict[d] to samples[-1].getval(d) instead of [sample.getval(d) for sample in samples]. My bad, I didn;t look closely enbough to se

Re: Making things more functional in Python

2005-03-04 Thread Michael Hoffman
Steve Holden wrote: return dict([(d, sample.getval(d)) for d in dset for sample in samples]) That won't do what the original code does. This sets dict[d] to samples[-1].getval(d) instead of [sample.getval(d) for sample in samples]. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/pytho

Re: best XSLT processor?

2005-03-04 Thread uche . ogbuji
Steve Holden: "I don't know what news reader you are using, but I wonder if I could ask you to retain just a little more context in your posts. If they were personal emails I would probably be able to follow the thread, but in a newsgroup it's always helpful when I see a comment such as your above

Re: get textual content of a Xml element using 4DOM

2005-03-04 Thread uche . ogbuji
I suggest using minidom or pxdom [1] rather than 4DOM. If you insist on using 4DOM, xml.dom.ext.Print(node) or xml.dom.ext.PrettyPrint(node) does what you want. [1] http://www.doxdesk.com/software/py/pxdom.html --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: get textual content of a Xml element using 4DOM

2005-03-04 Thread uche . ogbuji
I suggest using minidom or pxdom [1] rather than 4DOM. If you insist on using 4DOM, xml.dom.ext.Print(node) or xml.dom.ext.PrettyPrint(node) does what you want. --Uche -- http://mail.python.org/mailman/listinfo/python-list

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Patrick Useldinger
Grant Edwards wrote: If you install cygwin there almost always is. If you install cygwin there's no need for what the OP describes. -pu -- http://mail.python.org/mailman/listinfo/python-list

Re: Geneator/Iterator Nesting Problem - Any Ideas? 2.4

2005-03-04 Thread ChaosKCW
Hi Thanks this was very helpfull. Your final solution seems like the best (most elegant). I was trying to avoid the ugly while loops with breaks and this final one certainly does that. Thanks for your help . -- http://mail.python.org/mailman/listinfo/python-list

Re: winnt win32process.createProcess with stdout to file ?

2005-03-04 Thread david . humpherys
Aweseome! Many many thanks Roger ! You've made my day. The last thing that you may be able to help with... I'm using win32api.TerminateProcess(hProcess,3) to kill this process if it gets outta hand... but when i do so.. it seems that the stdout/stderr don't capture the output. here's my last chun

Re: Making things more functional in Python

2005-03-04 Thread Bill Mill
On Fri, 4 Mar 2005 08:36:49 -0800 (PST), gf gf <[EMAIL PROTECTED]> wrote: > Is there a better, more FP style, more Pythonic way to > write this: > > def compute_vectors(samples, dset): > vectors = {} > for d in dset: > vectors[d] = [sample.get_val(d) for sample in >

Re: Setting default option values for Tkinter widgets

2005-03-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: Eric, your tagline doesn't parse correctly on my Python 2.4 shell. So, are you using Windows? [EMAIL PROTECTED] /c/Python24/Lib/site-packages $ python -c 'print "".join([chr(154 - ord(c)) for c in "U(17zX(%,5.z5(17l8(%,5.Z*(93-965$l7+-"])' Eric Brunel [EMAIL PROTECTED] re

Re: Making things more functional in Python

2005-03-04 Thread Steve Holden
gf gf wrote: Is there a better, more FP style, more Pythonic way to write this: def compute_vectors(samples, dset): vectors = {} for d in dset: vectors[d] = [sample.get_val(d) for sample in samples] return vectors Namely, I'd like to get rid of the initilizat

Re: Making things more functional in Python

2005-03-04 Thread Michael Hoffman
gf gf wrote: Is there a better, more FP style, more Pythonic way to write this: def compute_vectors(samples, dset): vectors = {} for d in dset: vectors[d] = [sample.get_val(d) for sample in samples] return vectors Namely, I'd like to get rid of the initilizat

Making things more functional in Python

2005-03-04 Thread gf gf
Is there a better, more FP style, more Pythonic way to write this: def compute_vectors(samples, dset): vectors = {} for d in dset: vectors[d] = [sample.get_val(d) for sample in samples] return vectors Namely, I'd like to get rid of the initilization (vector

Re: Geneator/Iterator Nesting Problem - Any Ideas? 2.4

2005-03-04 Thread Steven Bethard
ChaosKCW wrote: For reasons of pure asthetics and my own learning I wanted it to look like this: def resultsetbatchgen(cursor, size=100): for results in (recordbatch for recordbatch in cursor.fetchmany(size)): for rec in results: yield rec Note that this is equivalent to:

(no subject)

2005-03-04 Thread python-list-bounces+archive=mail-archive . com
#! rnews 2494 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wns13feed!worldnet.att.net!12.120.4.37!attcg2!ip.att.net!xyzzy!nntp From: Jeff Sandys <[EMAIL PROTECTED]> Subject: Re: Delete first line f

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Steven Bethard
Grant Edwards wrote: On 2005-03-04, Patrick Useldinger <[EMAIL PROTECTED]> wrote: John Leslie wrote: Or does anyone have a python script which takes a standard unix command as an argument and runs the pyton/windows equivalent on windows? There's not always an equivalent command. If you install cy

[Numeric] column vector faster than row vector in mat multiply?

2005-03-04 Thread Zhang Le
Hi, I did a small benchmark of matrix-vector multiply operation using Numeric module. I'm a bit suprised to find matrix*col-vector is much faster than row-vector*matrix. I wonder whether other people have observed this fact too, and why? Below is the code I used, with output from my machine.

Re: Setting default option values for Tkinter widgets

2005-03-04 Thread [EMAIL PROTECTED]
Eric, your tagline doesn't parse correctly on my Python 2.4 shell. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python glade tute

2005-03-04 Thread Harlin Seritt
Not to make light of your tutorial but it can use some editing (the English grammar and spelling is below par). I understand that most likely English is not your first language. Given that, I think you did a great job. If you like, email me back and I'll be glad to help out with that, but I can onl

Re: Call variable as a function

2005-03-04 Thread Nick Coghlan
Steve Holden wrote: There's always a way: >>> def test(): ... print "hello" ... >>> var = "test" >>> eval("%s()" % var) hello I'd go with locals() for the simple case of a name lookup: Py> def test(): ... print "Hi there!" ... Py> var = "test" Py> locals()[var]() Hi there! Cheers, Nick. -- N

Geneator/Iterator Nesting Problem - Any Ideas? 2.4

2005-03-04 Thread ChaosKCW
Hi Using Python 2.4 I am trying to procduce a generator which will return the results of dbi SQL statement using fetchmany for performance. So instead of fetching one record for each call, I will fetch batches of X (eg 100) and yeild each record in turn. For reasons of pure asthetics and my own

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Grant Edwards
On 2005-03-04, Patrick Useldinger <[EMAIL PROTECTED]> wrote: > John Leslie wrote: > >> Or does anyone have a python script which takes a standard unix >> command as an argument and runs the pyton/windows equivalent on >> windows? > > There's not always an equivalent command. If you install cygwin

python upgrade process...

2005-03-04 Thread bruce
hi... i currently have a rh8.0 server that is a little messed up!! i need to know what's the best/right process to upgrade to the latest python/mod_python, and any associated libs i need to make sure that i don't break the gnome/httpd, or any other python dependent app... currently i have di

Re: "Static" python program

2005-03-04 Thread Pink
Daniel Frickemeier wrote: > Hi, > > I have a strange problem. > > I´m developing a small python-program wiht the mysql-python-module. > The program should run on a server without any mysql-installation. > Is there any posibility to "kompile" a python with static libaries? MySQL distributions (a

Re: Python glade tute

2005-03-04 Thread dimitri pater
hello, I would certainly want to collaborate on writing Python tutorial for kids (I've got a small kids myself (7, 5, 3)). I already wrote some tutorials that make heavy use of screenshots (serpia.com) but they are for big kids like us ;-) Please contact me, maybe we can work something out. I'd be

Re: Python glade tute

2005-03-04 Thread adamc
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2005-03-04, somesh <[EMAIL PROTECTED]> wrote: > hello, > I wrote a small tute for my brother to teach him python + glade, > plz see, and suggest to make it more professional , > In tute I discussed on Glade + Python for developing Applications too >

Re: Creating module skeleton from unit tests

2005-03-04 Thread Fabio Zadrozny
I think that the best approach I saw to this was in the Eclipse java ide... You can basically go on the declaration of self.obj = player.Player('Fred the Adventurer') press Ctrl+1 and it adds a suggestion to create the class Player. Then go to assert self.obj.name == 'Fred the Adventurer' press C

Re: Wishful thinking : unix to windows script?

2005-03-04 Thread Patrick Useldinger
John Leslie wrote: Or does anyone have a python script which takes a standard unix command as an argument and runs the pyton/windows equivalent on windows? There's not always an equivalent command. -pu -- http://mail.python.org/mailman/listinfo/python-list

win32 COM and data types / direction

2005-03-04 Thread Alexander Eisenhuth
Hello everybody, i wonder how the win32 COM extension handles different C-int types (short, int, long). Another question for me is weather the "out-direction" of parameter is supported "out of the box" ? To clarify look at the methode "FunWithTwoInts"

Fast 2d brown/pink noise generation?

2005-03-04 Thread Mathias
Dear NG, I'm looking for a fast way to produce 2d-noise images with 1/f or 1/f^2 spectrum. I currently generate the noise via inverse FFT, but since I need lots of data (~10^7 for a monte carlo simulation) it needs to be really fast. Does someone know a faster way than my approach? - Dimensiona

  1   2   >