Re: QDoubleValidator

2010-01-14 Thread Helvin
he working code here: http://learnwithhelvin.blogspot.com/2010/01/qdoublevalidator.html Helvin -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove empty strings from list

2009-09-14 Thread Helvin Lui
Thanks Chris! Thanks for the quick reply. Indeed this is the case! I have now written out a new list, instead of modifying the list I am iterating over. Logged at my blog: http://learnwithhelvin.blogspot.com/2009/09/python-loop-and-modify-list.html Regards, Helvin =) On Tue, Sep 15, 2009 at 1

Remove empty strings from list

2009-09-14 Thread Helvin
st is: ['44', '', '', '0.0\n'] The code above removes all the empty strings in the middle, all except two. My code seems to miss two of the empty strings. Would you know why this is occuring? Regards, Helvin -- http://mail.python.org/mailman/listinfo/python-list

Re: QTableWidgetItem-list

2009-09-13 Thread Helvin
On Sep 14, 7:18 am, Helvin wrote: > Hi, > > Could not find anything on this online, except the documentation, > which does not explain how to work with a QTableWidgetItem-list. How > do I get out what QWidgetTable.finditems found? > > I have a string that I want to find i

QTableWidgetItem-list

2009-09-13 Thread Helvin
table picked_node: an integer value I want to locate in table_points Help MUCH appreciated! Helvin Newbie -- http://mail.python.org/mailman/listinfo/python-list

Re: global variable not working inside function. Increment

2009-09-04 Thread Helvin Lui
Wow!!! Thanks a million!! It worked! = DThanks for the fast reply too! Helvin On Sat, Sep 5, 2009 at 11:52 AM, Rami Chowdhury wrote: >global no_picked >>no_picked = 0 >> >>def picked(object, event): >> no_picked += 1 >> print no_

global variable not working inside function. Increment

2009-09-04 Thread Helvin
print no_picked Error msg says: UnboundLocalError: local variable 'no_picked' referenced before assignment For some reason, no_picked does not increment, but the printing statement works. Do you know why? (I'm actually writing this for a vtkrenderwindowinteractor.) Helvin -- http://ma

Re: string find mystery

2009-09-02 Thread Helvin Lui
tr.find returns -1 on failure; and -1 is a true value. Only > 0, empty string, empty sequences, etc, are false values. > > So, you have to test, 'if find_str.find(pattern) != -1:' > > HTH, > > --S > -- Helvin "Though the world may promise me more, I'm just made to be filled with the Lord." -- http://mail.python.org/mailman/listinfo/python-list

string find mystery

2009-09-02 Thread Helvin
27;I found geometry' is printed. However, if instead of using file_str.find(), I use file_str.endswith(), it does not exhibit this strange behaviour. Obviously, I want the elif line to be true, instead of the first if statement. Does anyone know why this is happening? Help much appreciated! Very puzzled, Helvin -- http://mail.python.org/mailman/listinfo/python-list

Qstrings to Strings

2009-09-02 Thread Helvin
Just wanted to say, to convert qstrings (or integers for that matter) to strings, use the str() function. http://learnwithhelvin.blogspot.com/2009/09/qstrings-and-strings.html -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt GUI

2009-09-01 Thread Helvin
the source. I have blogged in more detail here: http://learnwithhelvin.blogspot.com/2009/09/embedding-vtk-into-pyqt-gui. My VTK stuff are now displayed in my GUI! =D Welcome to ask, if my blog is not detailed enough. I just wasn't bothered to put my entire file on there. Helvin --

Search and write to .txt file

2009-08-11 Thread Helvin
Hi everyone, I am writing some python script that should find a line which contains '1' in the data.txt file, then be able to move a certain number of lines down, before replacing a line. At the moment, I am able to find the line '1', but when I use f.seek to move, and then rewrite, what I write g

Re: PyQt GUI

2009-07-26 Thread Helvin
On Jul 24, 5:03 am, Robert Kern wrote: > On 2009-07-23 03:55, Helvin wrote: > > > I believe I now have vtkpython.exe. However, my 'import vtk' statement > > in my python code is not working. The error says something like "no > > module named vtk". &g

Re: PyQt GUI

2009-07-23 Thread Helvin
Or do I have to use OpenGL? Confused... Helvin -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt GUI

2009-07-09 Thread Helvin
On Jul 10, 3:54 am, Robert Kern wrote: > On 2009-07-09 01:27, Helvin wrote: > > > > > > > On Jul 9, 11:29 am, Robert Kern  wrote: > >> On 2009-07-08 18:10, Helvin wrote: > > >>> Thanks for the fast replies! I will look into how to use VTK now. >

Re: PyQt GUI

2009-07-09 Thread Helvin
On Jul 9, 6:27 pm, Helvin wrote: > On Jul 9, 11:29 am, Robert Kern wrote: > > > > > > > On 2009-07-08 18:10, Helvin wrote: > > > > Thanks for the fast replies! I will look into how to use VTK now. > > > Where would I find VTK's explicit support f

Re: PyQt GUI

2009-07-08 Thread Helvin
On Jul 9, 11:29 am, Robert Kern wrote: > On 2009-07-08 18:10, Helvin wrote: > > > Thanks for the fast replies! I will look into how to use VTK now. > > Where would I find VTK's explicit support for PyQt? > > Wrapping/Python/vtk/qt4/ in the VTK sources. > > &g

Re: PyQt GUI

2009-07-08 Thread Helvin
On Jul 8, 9:23 pm, Phil Thompson wrote: > On Wed, 08 Jul 2009 11:11:51 +0200, "Diez B. Roggisch" > > wrote: > > > > > > > Helvin wrote: > > >> Hi experts! > > >> I'm developing a GUI for a software using PyQT, and need 3D >

PyQt GUI

2009-07-08 Thread Helvin
but I don't know how to use it in my code, as when I run it, an error says it can't find the vtk module. Help would be so appreciated! Helvin -- http://mail.python.org/mailman/listinfo/python-list