Switching windows in PyQT

2008-12-03 Thread ShanMayne
Greetings All

I am new to PyQT and GUI programming in general. What tutorials I have
found are relatively clear on standard operations within a single
window (QtGui.QWidget or QtGui.QMainWindow). Exiting this window exits
the overall application.

How would I switch between windows, that is close one and open
another, within a running application. I would imagine this to be a
standard feature often coded.

My thanks
Shannon
--
http://mail.python.org/mailman/listinfo/python-list


Numpy record array - field names for all dimensions

2008-12-03 Thread ShanMayne
Greetings All

I am seeking to represent datasets where each data element is the
calculated result from several (4 for now) other data types. A matrix-
like (in the general mathematical sense) seems logical, where the
intersection of each of the 4 values (from different data sets) holds
the value derived from those 4 values here serving as indexes.

So, each matrix/array element is associated with 4 fields.
eg:
matrix element/output value =  24.235  -->
 'Formula' = 'C12H24O2N2'
 'Solvent' =  'Acetonitrile'
 'fragmentation_method' = 'CID'
 'resolution' = 'unit'

ideally I would like to call the output value by indexing the matrix
with the input information. eg:

matrix['C12H24O2N2']['Acetonitrile']['CID']['unit'] = 24.235

Numpy's record arrays seemingly don't allow all dimensions to carry
field names. ie. each column/row carrying a label. Instead fieldname
usage appears to create a "new dimension" as denoted by square
brackets.

eg:
pixel_matrix = array([[(1,2,3), (4,5,6)], [(7,8,9), (10,11,12)]],
[('r',float32),('g',float32),('b',float32)])


Q:
Can anyone tell me if the sort of data structuring I seek can be done
with Numpy record arrays or, if not, can you recommend a more suitable
module?

Great & Glowing Thanks!
--
http://mail.python.org/mailman/listinfo/python-list


Re: Switching windows in PyQT

2008-12-05 Thread ShanMayne
On Dec 3, 8:12 pm, Дамјан Георгиевски <[EMAIL PROTECTED]> wrote:
> > I am new to PyQT and GUI programming in general. What tutorials I have
> > found are relatively clear on standard operations within a single
> > window (QtGui.QWidget or QtGui.QMainWindow). Exiting this window exits
> > the overall application.
>
> > How would I switch between windows, that is close one and open
> > another, within a running application. I would imagine this to be a
> > standard feature often coded.
>
> most often you don't close windows but hide them.
>
> Still, the app object has a property quitOnLastWindowClosed that you can
> set to false.
>
> --
> дамјан (http://softver.org.mk/damjan/)
>
> Q: What's tiny and yellow and very, very, dangerous?
> A: A canary with the super-user password.



Thanks, that does sound like a more accessible way of doing it. Would
know where I could find full application code (as an example to me) so
that I can get to grips with the details of it all?

Good stuff, merry be
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to get an object's name as a string?

2008-10-29 Thread ShanMayne

> The simplest and best option here is to store the objects in a
> dictionary with their keys being the generated names.

Thanks. Indeed Alex, that may well be the simplest way, to have an
overarching Dictionary of references/names and objects.

However this does not help me to use the reference/name of an object I
imported instead of created.

#-#

There has been much debate over terminology but I was under the
impression that there was a simple input-output defined task in
question.

Inherently a the variable/name/reference maps to the object it was
assigned to. The question is can one map it the other way? If there
are multiple assignments to the same object can they be listed? This
applies to the "names" object atributes as well.

Joe has mentioned that I shouldn't need to do this and should perhaps
rethink my problem formulation. Nonetheless, I would still like to
know how it might be done.

Thanks
Shannon

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


Re: How to get an object's name as a string?

2008-10-29 Thread ShanMayne
Indeed they do. My delighted thanks. You have most precisely addressed
the problem I intended to convey.

I should have given the case of module attributes a moments further
thought, an obvious answer. The locals() was unknown to me (rookie
gaps).

Thank you for the elaborated illustration.

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