used to work at ungerer lab?

2006-09-01 Thread lind
I am looking for an old friend, used to work at a path lab in Pretoria,
dabbled in Scientology and rock climbing?  I know this is not
friendster.com, but I really have to get into contact with him.

Hendrik van Rooyen wrote:
> <[EMAIL PROTECTED]> Wrote:
>
>
> | Hi,
> | I need help about Tkinter listbox widget.I want,when somebody click on
> | any item(file)  in Listbox,then in new Label widget text must be
> | selected item from server.
> |
> | my program (wrong example):
> |
> | import ftputil
> | import Tkinter
> | root=Tkinter.Tk()
> | ftp=ftputil.FTPHost('some imaginary server')
> |
> | def LabelWidget(event):
> | a=Tkinter.Label(root,text=)  # Text must be only name and file
> | format,example: sun.gif
> | a.grid()
> |
> |
> |
> | b=Tkinter.Listbox(root)
> | b.insert(Tkinter.END,ftp._dir(''))
> | b.place()
> | c=Tkinter.Button(root,text='PRINT THIS FILE IN NEW LABEL WIDGET')
> | c.bind('',LabelWidget)
> | c.grid()
> | root.mainloop()
> |
> |
> | THANKS!!!
>
>
> idx = b.curselection()# - tells you which one was clicked
> StringValue = b.get(idx) # - returns the text
> 
> HTH - Hendrik

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: used to work at ungerer lab?

2006-09-01 Thread lind
Yes, and Du Buisson's and a variety of others. Liked spiders and spent
time at the WNNR?
lind wrote:
> I am looking for an old friend, used to work at a path lab in Pretoria,
> dabbled in Scientology and rock climbing?  I know this is not
> friendster.com, but I really have to get into contact with him.
>
> Hendrik van Rooyen wrote:
> > <[EMAIL PROTECTED]> Wrote:
> >
> >
> > | Hi,
> > | I need help about Tkinter listbox widget.I want,when somebody click on
> > | any item(file)  in Listbox,then in new Label widget text must be
> > | selected item from server.
> > |
> > | my program (wrong example):
> > |
> > | import ftputil
> > | import Tkinter
> > | root=Tkinter.Tk()
> > | ftp=ftputil.FTPHost('some imaginary server')
> > |
> > | def LabelWidget(event):
> > | a=Tkinter.Label(root,text=)  # Text must be only name and file
> > | format,example: sun.gif
> > | a.grid()
> > |
> > |
> > |
> > | b=Tkinter.Listbox(root)
> > | b.insert(Tkinter.END,ftp._dir(''))
> > | b.place()
> > | c=Tkinter.Button(root,text='PRINT THIS FILE IN NEW LABEL WIDGET')
> > | c.bind('',LabelWidget)
> > | c.grid()
> > | root.mainloop()
> > |
> > |
> > | THANKS!!!
> >
> >
> > idx = b.curselection()# - tells you which one was clicked
> > StringValue = b.get(idx) # - returns the text
> > 
> > HTH - Hendrik

-- 
http://mail.python.org/mailman/listinfo/python-list


Static executable with shared modules

2005-01-14 Thread Rickard Lind
Is there any way to build the python executable statically and
still be able to load modules built as shared libraries?
I'm trying to run python scripts on a stripped down FreeBSD (4.9)
machine which has no shared system libraries so I want to link it
statically against libc et al, but it would be nice to still be
able to load modules which were built as shared libraries. In
particular I have a library for which I've generated a wrapper
with swig which I'd like to import.
I've googled up and down but can't find anyone who has tried this
particular combination. Just adding a -static to the Makefile
seems to remove the ability to load shared libraries altogether
as I get a "ImportError: Service unavailable" exception.
/r
--
http://mail.python.org/mailman/listinfo/python-list


Re: Static executable with shared modules

2005-01-17 Thread Rickard Lind
Martin v. Löwis wrote:
> I'm not what "build statically" means; if you talking about
> building a statically linked interpreter binary - then no,
> this is not possible. At a minimum, you need to link with -ldl,
> or else you cannot perform dlopen(3).
I'll be more specific: when I build python 2.3.4 on FreeBSD 4.9,
the interpreter binary is linked against three shared libraries: 
libutil.so.3, libm.so.2 and libc_r.so.4. Now, these libraries are
not present on the TARGET system (which is distinct from the build
system, but based on the same version of FreeBSD) so I add "-static"
to LDFLAGS. This produces an interpreter that runs on the target
system (no dependency on shared libc etc) but it also cannot load
modules compiled as shared libraries. Man page for dlopen(3) says
it is located in libc (and consquently there seems to be no libdl),
and anyway I'd expect to get a link error if the dl* functions were
not present. What I DO get is an ImportError exception.

At present I see no other option than to link the modules into the
interpreter which is very inconvenient since I'll have to rebuild
the every time a module changes :-(
/r
--
http://mail.python.org/mailman/listinfo/python-list


Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Gregg Lind
One difficulty I am having with using Python for scientific computing is 
that I cannot figure out good ways to get arbitrary (unpatterned?) slices.

As an example, in R or Matlab / Octave, syntax exists such that:

vals = range(6)
wanted = [1,2,3,1,1,1]
vals[wanted] = [1,2,3,1,1,1]

Both of those languages also allow for using filter-like functionality:

Truths = [True,False,False,False,True,True]
valse[Truths] = [0,4,5]

In Python, solutions I have found for these tasks are:

[vals[ii]  for ii in wanted]# task 1

[a[1]  for  in zip(Truths,vals) if  a[0] ]  # task 2


I find neither of these to be very satisfying.  Is there some other 
method for doing this?  I was unable to find a PEP relating to this, and 
would appreciate any help the combined brains of the Python world can give.

Gregg L.



-- 
http://mail.python.org/mailman/listinfo/python-list


Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Gregg Lind
I wish something like this was part of the standard python installation, 
and didn't require one to use Numpy or Numarray.  This sort of list 
subsetting is useful in many, many contexts. 

-- 
http://mail.python.org/mailman/listinfo/python-list


__init__ explanation please

2008-01-12 Thread Erik Lind
I'm new to Python, and OOP. I've read most of Mark Lutz's book and more 
online and can write simple modules, but I still don't get when __init__ 
needs to be used as opposed to creating a class instance by assignment. For 
some strange reason the literature seems to take this for granted. I'd 
appreciate any pointers or links that can help clarify this.

Thanks


-- 
http://mail.python.org/mailman/listinfo/python-list


help with slicing/replacing matrix sections.

2008-01-14 Thread Erik Lind
I see a more complicated thread on a similar sounding question, but my 
question is simpler, I hope.

I have a large numpy matrix, initially created as:

Mat = zeros((a,b), int)

and a smaller array with other data

Sub = [1,2,3,4,5],[6,7,8,9,0]

I want to replace a section of Mat matrix with Sub matrix without having to 
loop through each cell in each matrix individually.

I thought index/slice assignments, should be able to do that, but I can only 
get it to work (as per book examples) with simple arrays. Every syntax 
combination I have tried gives one error or another, typically "can't 
broadcast an object", but intuitively it seems there should be a simple 
solution.

In short, how do I insert the data in the two (or any number of) rows in 
Sub[0:2] into any part of Mat starting at Mat[x,y] without using "for" loops 
? 


-- 
http://mail.python.org/mailman/listinfo/python-list


A question about event handlers with wxPython

2008-01-14 Thread Erik Lind
I'd appreciate any pointer on a simple way to tell within an event handler 
where the event came from.
I want to have "while" condition in a handler to stop or change processing 
if an event occurs from some other button click.

Trying to bind more than one event to the same handler still doesn't tell me 
where the event came from in a basic bind. Is there an argument I can put in 
the bind so as to identify the source of the event in the event argument? .





-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A question about event handlers with wxPython

2008-01-15 Thread Erik Lind
> def HandleSomething(self, event):
>generating_control = event.GetEventObject()
>print generating_control
>
> HTH,

Thank you.That is what I was looking for, but as often seems the case, one 
thing exposes another. Is there any way to listen for events without 
specifically binding to a handler (it seems one cannot bind an event to two 
handlers?)? One could do so with globals, but I'm trying to avoid that.

For example, "press any button to stop"


def HandleSomething(self, event):
.
 while generating_control: == something:
run
else
stop


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A question about event handlers with wxPython

2008-01-15 Thread Erik Lind
That all looks cool. I will experiment more. I'm a bit slow on this as only 
two weeks old so far.

Thanks for the patience


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A question about event handlers with wxPython

2008-01-16 Thread Erik Lind

"Mike Driscoll" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Jan 15, 2:20 pm, "Erik Lind" <[EMAIL PROTECTED]> wrote:
>> That all looks cool. I will experiment more. I'm a bit slow on this as 
>> only
>> two weeks old so far.
>>
>> Thanks for the patience
>
> No problem. I'm pretty slow with some toolkits too...such as
> SQLAlchemy. Ugh.
>
> Mike

BTW,

The wxPython group that you mentionedis that 
http://wxforum.shadonet.com/?





-- 
http://mail.python.org/mailman/listinfo/python-list