Re: ZODB for inverted index?

2006-10-24 Thread vd12005
thanks for your reply, anyway can someone help me on how to "rewrite" and "reload" a class instance when using ZODB ? regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting by item_in_another_list

2006-10-24 Thread ZeD
Paul Rubin wrote: >> A = [0,1,2,3,4,5,6,7,8,9,10] >> B = [2,3,7,8] >> >> desired_result = [2,3,7,8,0,1,4,5,6,9,10] > > How about: > > desired_result = B + sorted(x for x in A if x not in B) this. is. cool. -- Under construction -- http://mail.python.org/mailman/listinfo/python-list

Re: numbers to string

2006-10-24 Thread Travis E. Oliphant
David Isaac wrote: y > [116, 114, 121, 32, 116, 104, 105, 115] z=''.join(chr(yi) for yi in y) z > 'try this' > > What is an efficient way to do this if y is much longer? > (A numpy solution is fine.) Here's another numpy solution just for fun: import numpy z = numpy.array(y,dtype=

Eschew obfuscation (was: Want to reduce steps of an operation with dictionaries)

2006-10-24 Thread Ben Finney
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > >> How can I do this with one line of instruction? > > > > As a general piece of advice, [...] Don't try to compress things > > into fewer lines unless that actually makes it clearer to read. > > I was about to suggest adding some

Re: Sorting by item_in_another_list

2006-10-24 Thread Fredrik Lundh
Delaney, Timothy (Tim) wrote: > That says pretty strongly to me that it's part of the language > specification. And I'm pretty sure Guido said as much when he > pronounced. oops. I'll blame it all on google's ability to bring up the wrong page on python.org when you do a quick google. guess I

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Fredrik Lundh
Ben Finney wrote: >> How can I do this with one line of instruction? > > Why one line? > > As a general piece of advice, try writing dumb, obvious code that > actually does the transformation you want, and then let us see > that. Don't try to compress things into fewer lines unless that > actual

Re: python GUIs comparison (want)

2006-10-24 Thread Fredrik Lundh
David Boddie wrote: >> commercial deployment is expensive; free deployment must be GPL; > > Opinions differ on the first one of these. even if you define "expensive" as "costs more money than the others" ? -- http://mail.python.org/mailman/listinfo/python-list

RE: Sorting by item_in_another_list

2006-10-24 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > Delaney, Timothy (Tim) wrote: > >> This is a requirement for all implementations claiming to be 2.3 or >> higher. > > the language reference only guarantees this for CPython: > > The C implementation of Python 2.3 introduced a stable > sort() method, but code th

Re: Sorting by item_in_another_list

2006-10-24 Thread Fredrik Lundh
Delaney, Timothy (Tim) wrote: > This is a requirement for all implementations claiming to be 2.3 or > higher. the language reference only guarantees this for CPython: The C implementation of Python 2.3 introduced a stable sort() method, but code that intends to be portable across

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Ben Finney
[EMAIL PROTECTED] writes: > I have next dictionaries: > a={'a':0, 'b':1, 'c':2, 'd':3} > b={'a':0, 'c':1, 'd':2, 'e':3} > I want to put in a new dictionary named c all the keys that are in b > and re-sequence the values. The result I want is: > c={'a':0, 'c':1, 'd':2} Okay, it seems that what you

Re: Getting a lot of SPAM from this list

2006-10-24 Thread Paul Rubin
"Eric S. Johansson" <[EMAIL PROTECTED]> writes: > I have a solution that has been working for me for the past three or > four years. I'm almost done with the next release (I pray) with a > better installation process as well as improvements throughout the > system. I've given up on email pretty m

Re: Getting a lot of SPAM from this list

2006-10-24 Thread Eric S. Johansson
[EMAIL PROTECTED] wrote: > Gabriel> I use a discardable email address from Yahoo. Spam filtering is > Gabriel> good, and when you get too much spam, just delete that address > Gabriel> and create another one. > > Maybe it's just me, but creating and discarding email addresses makes me

Re: Obtaining SSL certificate info from SSL object - BUG?

2006-10-24 Thread John Nagle
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > >>The reason this now matters is that new "high assurance" certs, >>the ones that tell you how much a site can be trusted, are now being >>deployed, > > > Oh my, I hadn't heard about this. They come up with new scams all the > time.

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Mike Erickson
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > Hello: > I have next dictionaries: > a={'a':0, 'b':1, 'c':2, 'd':3} > b={'a':0, 'c':1, 'd':2, 'e':3} > I want to put in a new dictionary named c all the keys that are in b > and re-sequence the values. The result I want is: > c={'a':0, 'c':1, 'd':2}

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Steve Holden
Carl Banks wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Hello: >>>I have next dictionaries: >>>a={'a':0, 'b':1, 'c':2, 'd':3} >>>b={'a':0, 'c':1, 'd':2, 'e':3} >>>I want to put in a new dictionary named c all the keys that are in b >>>and re-sequence the values. The result I wan

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread James Stroud
Ben Finney wrote: > [EMAIL PROTECTED] writes: > > >>I have next dictionaries: >>a={'a':0, 'b':1, 'c':2, 'd':3} >>b={'a':0, 'c':1, 'd':2, 'e':3} >>I want to put in a new dictionary named c all the keys that are in b >>and re-sequence the values. > > > They never had a sequence, so you can't "re-

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Carl Banks
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Hello: > > I have next dictionaries: > > a={'a':0, 'b':1, 'c':2, 'd':3} > > b={'a':0, 'c':1, 'd':2, 'e':3} > > I want to put in a new dictionary named c all the keys that are in b > > and re-sequence the values. The result I want is: > > c={'a':0,

Re: How to find out the directory that the py file is in?

2006-10-24 Thread John McMonagle
On Wed, 2006-10-25 at 02:49 +0100, Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > > > On Oct 24, 7:01 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > > >>At Tuesday 24/10/2006 20:39, [EMAIL PROTECTED] wrote: > >> > >> > >>>I have the following python script and some_command in the same >

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hello: > I have next dictionaries: > a={'a':0, 'b':1, 'c':2, 'd':3} > b={'a':0, 'c':1, 'd':2, 'e':3} > I want to put in a new dictionary named c all the keys that are in b > and re-sequence the values. The result I want is: > c={'a':0, 'c':1, 'd':2} > How can I do this wi

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Carl Banks
[EMAIL PROTECTED] wrote: > Hello: > I have next dictionaries: > a={'a':0, 'b':1, 'c':2, 'd':3} > b={'a':0, 'c':1, 'd':2, 'e':3} > I want to put in a new dictionary named c all the keys that are in b > and re-sequence the values. The result I want is: > c={'a':0, 'c':1, 'd':2} > How can I do this w

Re: [wxPython-users] Re:

2006-10-24 Thread Josiah Carlson
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 24/10/2006 23:25, Michael S wrote: > > >I extended part of my program in C, since that part > >was too involved for Python. Now when I import the > >module I created and call its functions, I am trying > >to feedback some information bac t

Re: numbers to string

2006-10-24 Thread Paul Rubin
"David Isaac" <[EMAIL PROTECTED]> writes: > >>> y > [116, 114, 121, 32, 116, 104, 105, 115] > >>> z=''.join(chr(yi) for yi in y) > >>> z > 'try this' > > What is an efficient way to do this if y is much longer? import array z = array.array('B',y).tostring() -- http://mail.python.org/mailman/list

Re: numbers to string

2006-10-24 Thread Robert Kern
David Isaac wrote: y > [116, 114, 121, 32, 116, 104, 105, 115] z=''.join(chr(yi) for yi in y) z > 'try this' > > What is an efficient way to do this if y is much longer? > (A numpy solution is fine.) With numpy, something like the following: >>> from numpy import * >>> y = [116,

Re:

2006-10-24 Thread Gabriel Genellina
At Tuesday 24/10/2006 23:25, Michael S wrote: I extended part of my program in C, since that part was too involved for Python. Now when I import the module I created and call its functions, I am trying to feedback some information bac to my wxPython program. The function runs for a while and I w

Re: win32com problem

2006-10-24 Thread Gabriel Genellina
At Tuesday 24/10/2006 23:20, [EMAIL PROTECTED] wrote: > tet = Synergy.StudyDoc.GetFirstTet(), perhaps? com_error: (-2147352573, 'Member not found.', None, None) Sorry, should have mentioned that I tried that already. Any thoughts on how to establish if the problem is with win32com or the 3rd p

numbers to string

2006-10-24 Thread David Isaac
>>> y [116, 114, 121, 32, 116, 104, 105, 115] >>> z=''.join(chr(yi) for yi in y) >>> z 'try this' What is an efficient way to do this if y is much longer? (A numpy solution is fine.) Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com problem

2006-10-24 Thread Aries Sun
Have you tried late binding? Does late binding produce the same error? Regards, Aries [EMAIL PROTECTED] wrote: > I'm interacting with a third party application using python and com. > However having problems and don't know what to look at next to resolve > the issue. > > The app. can be driven b

Re: return tuple from C to python (extending python)

2006-10-24 Thread Andrew Poelstra
On Tue, 2006-10-24 at 15:24 -0700, Kiran wrote: > Hi all, I want to make python call some C functions, process them and > return them. Try comp.lang.python -- Andrew Poelstra -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com problem

2006-10-24 Thread Gabriel Genellina
At Tuesday 24/10/2006 22:15, [EMAIL PROTECTED] wrote: Set Tet = Synergy.StudyDoc.GetFirstTet() tet = Synergy.StudyDoc.GetFirstTet Can you see the difference...? -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensaje

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Gabriel Genellina
At Tuesday 24/10/2006 21:29, [EMAIL PROTECTED] wrote: a={'a':0, 'b':1, 'c':2, 'd':3} b={'a':0, 'c':1, 'd':2, 'e':3} I want to put in a new dictionary named c all the keys that are in b and re-sequence the values. The result I want is: c={'a':0, 'c':1, 'd':2} How can I do this with one line of in

[no subject]

2006-10-24 Thread Michael S
Good day all. I extended part of my program in C, since that part was too involved for Python. Now when I import the module I created and call its functions, I am trying to feedback some information bac to my wxPython program. The function runs for a while and I wanted to update a progress bar, bu

Re: win32com problem

2006-10-24 Thread cfriedalek
> tet = Synergy.StudyDoc.GetFirstTet(), perhaps? com_error: (-2147352573, 'Member not found.', None, None) Sorry, should have mentioned that I tried that already. Any thoughts on how to establish if the problem is with win32com or the 3rd party app? -- http://mail.python.org/mailman/listinfo/py

Re: win32com problem

2006-10-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I'm interacting with a third party application using python and com. > However having problems and don't know what to look at next to resolve > the issue. > > The app. can be driven by VBS. The following VBS code works: > > Set Synergy = CreateObject("synergy.Synergy")

Re: How to find out the directory that the py file is in?

2006-10-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > > On Oct 24, 7:01 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >>At Tuesday 24/10/2006 20:39, [EMAIL PROTECTED] wrote: >> >> >>>I have the following python script and some_command in the same >>>directory. I have to call the python script from that directory. >>>O

Re: How to find out the directory that the py file is in?

2006-10-24 Thread Jerry
import os print os.path.dirname(os.path.abspath(__file__)) -- Jerry -- http://mail.python.org/mailman/listinfo/python-list

Re: I like python.

2006-10-24 Thread Jerry
Glad I could help. -- Jerry -- http://mail.python.org/mailman/listinfo/python-list

Re: Ctypes Error: Why can't it find the DLL.

2006-10-24 Thread Chetan
"Mudcat" <[EMAIL PROTECTED]> writes: Is the DLL loadable from a standalone C program? All that is needed is a call to LoadLibrary() and check the return. If the full path is not specified, the dll is searched in the predefined order - I believe it is executable directory - in this case, directo

Re: return tuple from C to python (extending python)

2006-10-24 Thread Chetan
"Kiran" <[EMAIL PROTECTED]> writes: > PyObject* toRet; > toRet = PyTuple_New(num_addr); > > then, in a for loop, i assign values to the tuple as follows: > > for ( i = 0; i < num_addr; i++ ) > { > printf("%d\n", dat[i]); > PyTuple_SET_ITEM(toRet, i, (PyObject*)dat[i] ); > }

win32com problem

2006-10-24 Thread cfriedalek
I'm interacting with a third party application using python and com. However having problems and don't know what to look at next to resolve the issue. The app. can be driven by VBS. The following VBS code works: Set Synergy = CreateObject("synergy.Synergy") Synergy.OpenProject "D:/temp/project.mp

Re: How to find out the directory that the py file is in?

2006-10-24 Thread [EMAIL PROTECTED]
On Oct 24, 7:01 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 24/10/2006 20:39, [EMAIL PROTECTED] wrote: > > >I have the following python script and some_command in the same > >directory. I have to call the python script from that directory. > >Otherwise, some_command won't be fou

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Ben Finney
[EMAIL PROTECTED] writes: > I have next dictionaries: > a={'a':0, 'b':1, 'c':2, 'd':3} > b={'a':0, 'c':1, 'd':2, 'e':3} > I want to put in a new dictionary named c all the keys that are in b > and re-sequence the values. They never had a sequence, so you can't "re-sequence" them. You have not, p

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hello: > I have next dictionaries: > a={'a':0, 'b':1, 'c':2, 'd':3} > b={'a':0, 'c':1, 'd':2, 'e':3} > I want to put in a new dictionary named c all the keys that are in b > and re-sequence the values. The result I want is: > c={'a':0, 'c':1, 'd':2} > How can I do this wi

Re: python GUIs comparison (want)

2006-10-24 Thread David Boddie
On Tuesday 24 October 2006 17:38, Kevin Walzer wrote: > PyQt: > Pro: Powerful, cross-platform, sophisticated GUI's > Con: Based on C++ toolkit; That's not a bad thing in itself. > docs assume knowledge of C++; Only to a point. I knew Python before I knew C++, and it didn't stop me from learning

Re: python GUIs comparison (want)

2006-10-24 Thread Peter Decker
On 24 Oct 2006 16:38:28 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > You load dabo and then load your program through dabo... That > was all I needed to know to disregard it. Wow - inaccurate and proud of it! Your loss. -- # p.d. -- http://mail.python.org/mailman/listinfo/python-li

Want to reduce steps of an operation with dictionaries

2006-10-24 Thread pretoriano_2001
Hello: I have next dictionaries: a={'a':0, 'b':1, 'c':2, 'd':3} b={'a':0, 'c':1, 'd':2, 'e':3} I want to put in a new dictionary named c all the keys that are in b and re-sequence the values. The result I want is: c={'a':0, 'c':1, 'd':2} How can I do this with one line of instruction? I attempted

Re: Sending Dictionary via Network

2006-10-24 Thread Steve Holden
mumebuhi wrote: > The simplejson module is really cool and simple to use. This is great! > > For others who are just starting to use Python (like myself), simply > download and decompress the source bundle then copy the simplejson > directory to your sys.path (e.g. /usr/lib/python2.4/). > Alterna

Re: strange problem

2006-10-24 Thread Steve Holden
ken wrote: > This file has 1,000,000+ lines in it, yet when I print the counter 'cin' > at EOF I get around 10,000 less lines. Any ideas? > > lineIn = > csv.reader(file("rits_feed\\rits_feed_US.csv",'rb'),delimiter='|') > for emp in lineIn: > cin=cin+1 > print cin My psyc

Re: return tuple from C to python (extending python)

2006-10-24 Thread Farshid Lashkari
Simon Forman wrote: > I have not done a great deal of extension work with python, however, I > do not believe you can simply cast an int (or pointer to int, which is > what you say dat is declared as, unless my C is /really/ rusty) to > PyObject*. > > I think you need to do something like Py_Build

Re: [0T] Re: Simple python + html + from --> to python script

2006-10-24 Thread Steve Holden
Bruno Desthuilliers wrote: > flit a écrit : > >>Hello All, >> >>I am trying to get information from a form and send it to a python >>script without success.. >>Here is my objective: >> >>User enters data in form --> form send variables to python script --> >>script runs and output result. > > >

Re: The status of Python and SOAP?

2006-10-24 Thread Waldemar Osuch
Thomas W wrote: > I'm going to give a presentation of python to my co-workers at a very > pro-microsoft workplace. Almost everything we need is currently > supported by the standard distro + the win32all package, but we also > need support for SOAP. I've tried SOAPpy ( didn't get it to compile, >

Re: How to find out the directory that the py file is in?

2006-10-24 Thread Gabriel Genellina
At Tuesday 24/10/2006 20:39, [EMAIL PROTECTED] wrote: I have the following python script and some_command in the same directory. I have to call the python script from that directory. Otherwise, some_command won't be found. I'm wondering how to make the following script working no matter what the

Re: return same type of object

2006-10-24 Thread Steve Holden
Bruno Desthuilliers wrote: > David Isaac a écrit : [...] > >>But Steve suggests going with the latter. > > > That's what I'd do too a priori. > Believe it or not, I wasn't at the priory when I wrote that. Sorry. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden W

Re: Sending Dictionary via Network

2006-10-24 Thread Simon Forman
mumebuhi wrote: > Thank you very much for the reply. > > Can pickle work directly with socket? The way I am doing right now is > to pickle the object to a file then send the file content through the > socket. Pickle aso has dumps() and loads() to work with strings rather than files. Peace, ~Simo

Re: Sending Dictionary via Network

2006-10-24 Thread Ben Finney
Larry Bates <[EMAIL PROTECTED]> writes: > mumebuhi wrote: > > Is it possible to send a non-string object from a Python program > > to another? I particularly need to send a dictionary over to the > > other program. However, this is not possible using the socket > > object's send() function. You w

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread Steve Holden
sturlamolden wrote: [...] > This was an extremely stupid question on my side. I take my hat off to anyone who's prepared to admit this. We all do it, but most of us try to ignore the fact. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http:/

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Ben Finney
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > In my experience [...] it's either the original author who provides > binaries, or none are provided. People certainly build it > themselves, but then never share. IIRC, the early days of Mozilla (after the code was released as free software) had t

Re: mean ans std dev of an array?

2006-10-24 Thread Robert Kern
Paul McGuire wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>>> n = len(a) >>>> mean = sum(a) / n >>>> sd = sqrt(sum((x-mean)**2 for x in a) / n) >>... >>>> If there is a faster way... like transferring the array to a >>>> different container class.

How to find out the directory that the py file is in?

2006-10-24 Thread [EMAIL PROTECTED]
I have the following python script and some_command in the same directory. I have to call the python script from that directory. Otherwise, some_command won't be found. I'm wondering how to make the following script working no matter what the working directory is. Thanks, Peng #!/usr/bin/env pyth

Re: python GUIs comparison (want)

2006-10-24 Thread [EMAIL PROTECTED]
I have to say that py-gtk is a pain to install. You have copywrites with the various parts of the library when you install all of it with apple and the people that do the pill library. I am looking at wxwindows and maybe vpython for graphics (If it will do what I want). wx.grid is a pain thus far

Re: Visibility against an unknown background

2006-10-24 Thread Ben Finney
Grant Edwards <[EMAIL PROTECTED]> writes: > The traditional way to draw lines on something with varying colors > is to use the "xor" operator when drawing the lines. But first, negotiate a patent license for this highly innovative and non-obvious technique that is "owned" as US Patent #4,197,590.

Re: Sending Dictionary via Network

2006-10-24 Thread mumebuhi
The simplejson module is really cool and simple to use. This is great! For others who are just starting to use Python (like myself), simply download and decompress the source bundle then copy the simplejson directory to your sys.path (e.g. /usr/lib/python2.4/). Thanks so much, Bruno. Buhi Bru

Re: Stylesheet not respected

2006-10-24 Thread Suren
It was nothing related to python but how my httpd.conf was setup. My apache conf was set to handle files under this. When I said href="body.css", it was looking under test\body.css. My project src was way deeper and I was assuming that it would like for the css file where the python source is.

Re: return tuple from C to python (extending python)

2006-10-24 Thread Simon Forman
Kiran wrote: > Hi all, I want to make python call some C functions, process them and > return them. > > Ok, I got all the wrapper functions and everything setup right. Here > is my problem. What I need to do is to return a tuple from C to > python. > > To go about doing this, I first create a tup

Re: Ctypes Error: Why can't it find the DLL.

2006-10-24 Thread Bruno Desthuilliers
Mudcat a écrit : > Hi, > > I can't figure out why ctypes won't load the DLL I need to use. I've > tried everything I can find (and the ctypes website is down at the > moment). Here's what I've seen so far. > > I've added the file arapi51.dll to the system32 directory. However > when I tried to a

Re: Sending Dictionary via Network

2006-10-24 Thread mumebuhi
Thank you very much for the reply. Can pickle work directly with socket? The way I am doing right now is to pickle the object to a file then send the file content through the socket. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stylesheet not respected

2006-10-24 Thread Irmen de Jong
Suren wrote: > I was able to the see weird stylesheet behavior on opera, IE and > mozilla under > mod_python. [snip] I'm 99% sure this has nothing to do with Python but is just an error in your CSS file. Show the CSS so we might be able to see the problem. One thing to check for though is that y

Re: Sending Dictionary via Network

2006-10-24 Thread Bruno Desthuilliers
mumebuhi a écrit : > Hi, > > Is it possible to send a non-string object from a Python program to > another? I particularly need to send a dictionary over to the other > program. However, this is not possible using the socket object's send() > function. > > Help? >>> d = dict(one=1, two="three",

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Martin v. Löwis wrote: Your news server doesn't honour cancel as well... > It doesn't need to, why do you think it does? This was an extremely stupid question on my side. It needs to be flushed after a write because that's how the memory pages mapping the file is synchronized with the file. Wri

Stylesheet not respected

2006-10-24 Thread Suren
I was able to the see weird stylesheet behavior on opera, IE and mozilla under mod_python. Here is some python code that exhibited the behavior. I have the body.css in the same folder as this file and the background is set to blue. When I access it at http://localhost/test.py, the html page shows

Re: Sending Dictionary via Network

2006-10-24 Thread Larry Bates
mumebuhi wrote: > Hi, > > Is it possible to send a non-string object from a Python program to > another? I particularly need to send a dictionary over to the other > program. However, this is not possible using the socket object's send() > function. > > Help? > > > Buhi > You will need to pick

Sending Dictionary via Network

2006-10-24 Thread mumebuhi
Hi, Is it possible to send a non-string object from a Python program to another? I particularly need to send a dictionary over to the other program. However, this is not possible using the socket object's send() function. Help? Buhi -- http://mail.python.org/mailman/listinfo/python-list

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Donn Cave wrote: > Wow, you're sure a wizard! Most people would need to look before > making statements like that. I know, but your news-server doesn't honour cancel messages. :) Python's mmap does indeed memory map the file into the process image. It does not fake memory mapping by means of fi

Re: strange problem

2006-10-24 Thread Bruno Desthuilliers
ken a écrit : > This file has 1,000,000+ lines in it, yet when I print the counter 'cin' > at EOF I get around 10,000 less lines. Any ideas? Not without seeing the file. But I'm not sure I want to see it !-) >lineIn = > csv.reader(file("rits_feed\\rits_feed_US.csv",'rb'),delimiter='|') >

return tuple from C to python (extending python)

2006-10-24 Thread Kiran
Hi all, I want to make python call some C functions, process them and return them. Ok, I got all the wrapper functions and everything setup right. Here is my problem. What I need to do is to return a tuple from C to python. To go about doing this, I first create a tuple object in C doing the fo

[0T] Re: Simple python + html + from --> to python script

2006-10-24 Thread Bruno Desthuilliers
flit a écrit : > Hello All, > > I am trying to get information from a form and send it to a python > script without success.. > Here is my objective: > > User enters data in form --> form send variables to python script --> > script runs and output result. If the script has side-effects (adding

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Martin v. Löwis wrote: > You know this isn't true in general. It is true for a 32-bit address > space only. Yes, but there are two other aspects: 1. Many of us use 32-bit architectures. The one who wrote the module should have considered why UNIX' mmap and Windows' MapViewOfFile takes an offset

Re: return same type of object

2006-10-24 Thread Bruno Desthuilliers
David Isaac a écrit : > Bruno wrote: > >>This is usually known as a 'factory method'. You do realise that both > > solutions are *not* strictky equilavent, do you? > > Your point I believe is that after inheritance the factory method > in the subclass will still > return MyClass() > but will ret

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread Martin v. Löwis
sturlamolden schrieb: > A patch would involve an new object, say, "mmap.mmap2" that thakes the > additional offeset parameter. I don't want it to break any code > dependent on the existing "mmap.mmap" object. Also, I think mmap.mmap2 > should allow the file object to be None, and in that case retu

Re: forcing a definition to be called on attribute change

2006-10-24 Thread Bruno Desthuilliers
Rob Williscroft a écrit : > Bruno Desthuilliers wrote in news:[EMAIL PROTECTED] in > comp.lang.python: > > >>>class cSphere() : >> >>OT : prefixing classes names with 'c' is totally unpythonic. > > > My understanding of "pythonic" is that its about how you use the > language not what style yo

Re: Debugging

2006-10-24 Thread Bruno Desthuilliers
Fulvio a écrit : > > On Monday 23 October 2006 19:10, Bruno Desthuilliers wrote: > > >>condition bpnumber [condition] >> >>Condition is an expression which must evaluate to true before the >>breakpoint is honored. If condition is absent, any existing condition is >>removed; i.e., the breakpo

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread sturlamolden
Fredrik Lundh wrote: > > to large to fit in a 32 address space. Thus, mmapmodule.c needs to be > > fixed before it can be used for large files. > > if you've gotten that far, maybe you could come up with a patch, instead > of stating that someone else "needs to fix it" ? I did not say "someone e

Re: Getting a lot of SPAM from this list

2006-10-24 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > >> Get a better spam filter? > > Colin> Any suggestions for Firefox? > > You can try SpamBayes (http://www.spambayes.org/). It has both POP3 and > IMAP filters that sit between your mail client and mail server. You control > and train them via a local web inte

Re: strange problem

2006-10-24 Thread Tim Chase
> This file has 1,000,000+ lines in it, yet when I print the counter 'cin' > at EOF I get around 10,000 less lines. Any ideas? > > lineIn = > csv.reader(file("rits_feed\\rits_feed_US.csv",'rb'),delimiter='|') > for emp in lineIn: > cin=cin+1 > print cin What happens if yo

Re: Simple python + html + from --> to python script

2006-10-24 Thread flit
Sorry but for a totally newbie the lib doccumentation doesnt help.. The target audience for the docs are for "grown ups" programmers.. I think I will do some tutorial, in baby steps... J. Clifford Dyer wrote: > A good starting place would be the documentation on python.org. > > In this case, the p

strange problem

2006-10-24 Thread ken
This file has 1,000,000+ lines in it, yet when I print the counter 'cin' at EOF I get around 10,000 less lines. Any ideas? lineIn = csv.reader(file("rits_feed\\rits_feed_US.csv",'rb'),delimiter='|') for emp in lineIn: cin=cin+1 print cin -- http://mail.python.org/mailman/

RE: Sorting by item_in_another_list

2006-10-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > The current documentation states that "Starting with Python 2.3, the > sort() method is guaranteed to be stable." However, it's not clear > whether this specifies language behavior that all implementations must > adhere to, or whether it simply documents an implementation de

Re: Simple python + html + from --> to python script

2006-10-24 Thread J. Clifford Dyer
A good starting place would be the documentation on python.org. In this case, the python library reference would have been helpful: http://docs.python.org/lib/lib.html Cheers, Cliff flit wrote: > Man > Very thanks... > I really try to find some source of good and simple and nothing.. > Man

Re: Simple python + html + from --> to python script

2006-10-24 Thread flit
Man Very thanks... I really try to find some source of good and simple and nothing.. Many thanks you are a great help! Steve Holden wrote: > flit wrote: > > Hello All, > > > > I am trying to get information from a form and send it to a python > > script without success.. > > Here is my objecti

Re: Simple python + html + from --> to python script

2006-10-24 Thread Steve Holden
flit wrote: > Hello All, > > I am trying to get information from a form and send it to a python > script without success.. > Here is my objective: > > User enters data in form --> form send variables to python script --> > script runs and output result. > > the form code > > Entre com > os dado

Re: default python when multiple python installation on the box

2006-10-24 Thread j_nwb
Does not help my immediate situation, but this understanding definitely helps. Thanks /J Martin v. Löwis wrote: > j_nwb schrieb: >>I have multiple python installations. 2.2, 2.3, 2.4. When I install a >> new package (pygtk2) , it always install in python 2.3. >>I changed the /usr/bin/pyth

Re: The status of Python and SOAP?

2006-10-24 Thread Paul Boddie
Thomas W wrote: > I'm going to give a presentation of python to my co-workers at a very > pro-microsoft workplace. Almost everything we need is currently > supported by the standard distro + the win32all package, but we also > need support for SOAP. I've tried SOAPpy ( didn't get it to compile, > n

Simple python + html + from --> to python script

2006-10-24 Thread flit
Hello All, I am trying to get information from a form and send it to a python script without success.. Here is my objective: User enters data in form --> form send variables to python script --> script runs and output result. the form code Entre com os dados Entre com os dados Vai magraum

Re: Attempting to parse free-form ANSI text.

2006-10-24 Thread Michael B. Trausch
Jean-Paul Calderone wrote: > On Sun, 22 Oct 2006 00:34:14 -0400, "Michael B. Trausch" > wrote: >> Alright... I am attempting to find a way to parse ANSI text from a >> telnet application. However, I am experiencing a bit of trouble. >> >> What I want to do is have all ANSI sequences _removed_ fro

Re: Visibility against an unknown background

2006-10-24 Thread Fredrik Lundh
Sergei Organov wrote: > > and doesn't work at all on medium gray or b/w dithered patterns. > > Yes, every method has its pros and cons, but XOR is probably most > efficient. back in the days when backing store was expensive, and memory bandwidth was limited, maybe. contemporary graphics har

Re: forcing a definition to be called on attribute change

2006-10-24 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Rob Williscroft wrote: > Bruno Desthuilliers wrote in news:[EMAIL PROTECTED] in > comp.lang.python: > >>> class cSphere() : >> >> OT : prefixing classes names with 'c' is totally unpythonic. > > My understanding of "pythonic" is that its about how you use the > languag

Help: Python2.3 & Python2.4 on RHEL4 x86_64

2006-10-24 Thread Christopher Taylor
Does anyone have any comments on my proposed solution? > However, I would like to propose a more flexible solution: Perhaps a > ./configure parameter called LIBLOC or something like that so that > LIBDIR = $(EXEC_PREFIX)/$(LIBLOC). Of course, LIBLOC should default > to "lib". This way the flexib

Re: The status of Python and SOAP?

2006-10-24 Thread Steven Bethard
Larry Bates wrote: > I would venture to guess that this is the one I would lean towards > if I needed SOAP support: > > http://www.effbot.org/downloads/#elementsoap > > I know is says "experimental" but Fredrik Lundh's idea of experimental > always seems to be everyone else's idea of a shipping p

Re: The status of Python and SOAP?

2006-10-24 Thread Larry Bates
I would venture to guess that this is the one I would lean towards if I needed SOAP support: http://www.effbot.org/downloads/#elementsoap I know is says "experimental" but Fredrik Lundh's idea of experimental always seems to be everyone else's idea of a shipping product (e.g his code just seems t

Re: default python when multiple python installation on the box

2006-10-24 Thread Martin v. Löwis
j_nwb schrieb: >I have multiple python installations. 2.2, 2.3, 2.4. When I install a > new package (pygtk2) , it always install in python 2.3. >I changed the /usr/bin/python to be 2.4 binary. Still the same behavior. >How does rpms, determine which installation to update ? Is there a >

Re: Visibility against an unknown background

2006-10-24 Thread Filip Salomonsson
On 10/24/06, Sergei Organov <[EMAIL PROTECTED]> wrote: > I'd be very upset to see, say, 5-6 highly intersecting > scientific plots on the same picture drawn using the > "marching ants" approach. I'd be a bit upset to see scientific plots *on a picture* at all, regardless of approach. -- filip sal

  1   2   3   >