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

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: 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] ); > }

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: I like python.

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

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

Tkinter question

2006-10-24 Thread Sorin Schwimmer
Thanks for everybody's advice, on both forums (tkinter-discuss & python-list).I end up using Fredrik's Lundh solution, since, in my project, multiple buttons are using the same callback, and their creation is controlled by the interaction with the user.Thanks again,Sorin-- http://mail.python.org/m

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

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

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

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

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

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

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

<    1   2   3