From dodi.ara at gmail.com Fri Jan 20 02:19:26 2012 From: dodi.ara at gmail.com (Dodi Ara) Date: Fri, 20 Jan 2012 08:19:26 +0700 Subject: [Pygui] QTableWidget - add from my files to table Message-ID: i wondering, how can i add from my files to table widget? for example, i have one file $ cat a tes $ so, the "test" fill in the one or more row or columns any help will be appreciate From jjmmma at gmail.com Fri Jan 20 09:55:03 2012 From: jjmmma at gmail.com (=?UTF-8?B?6aas5ZCJ6LuN?=) Date: Fri, 20 Jan 2012 16:55:03 +0800 Subject: [Pygui] QTableWidget - add from my files to table In-Reply-To: References: Message-ID: Hi, Will this piece of code work for you? f = open('test.txt','r') lines = []; for line in f: lines.append(line) table = QTableWidget(5,7) for i,j in zip(lines,range(len(lines))): item = QTableWidgetItem(i) table.setItem(1,j,item) BRs, Kimi ???? On Fri, Jan 20, 2012 at 9:19 AM, Dodi Ara wrote: > i wondering, how can i add from my files to table widget? > > > > for example, i have one file > > $ cat a > tes > $ > > so, the "test" fill in the one or more row or columns > > any help will be appreciate > _______________________________________________ > Pygui mailing list > Pygui at python.org > http://mail.python.org/mailman/listinfo/pygui > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattcampbell at pobox.com Fri Jan 20 20:27:32 2012 From: mattcampbell at pobox.com (Matt Campbell) Date: Fri, 20 Jan 2012 13:27:32 -0600 Subject: [Pygui] Embedded web browser control Message-ID: <58a7bc4ae47b35e3705a04f416e2d719@pobox.com> Hello: I think PyGUI should have a control for embedding a web browser in an application. Thisi could use IE's WebBrowser ActiveX control on Windows, WebKit on Mac, and the GTK port of WebKit on other Unix systems. I already have a basic implementation for Cocoa, if anyone is interested. Matt From greg.ewing at canterbury.ac.nz Sun Jan 22 00:56:12 2012 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sun, 22 Jan 2012 12:56:12 +1300 Subject: [Pygui] Bugs in PyGUI In-Reply-To: References: Message-ID: <4F1B509C.30801@canterbury.ac.nz> ??? wrote: > I found one small bugs in PyGUI when I run blobedit.py under python 3.2: > > File "C:\Python32\lib\site-packages\GUI\GStdMenus.py", line 82 > include = include + sum(always_include) > ^ > TabError: inconsistent use of tabs and spaces in indentation > > *Fix:* > Replace line 81 in C:\Python32\lib\site-packages\GUI\GStdMenus.py: > > #include = include + sum(always_include) > include = include.intersection(sum(always_include)) I don't understand this. There doesn't seem to be anything wrong with the indentation around that line in my source, and even if there was, I don't see how the change you suggest would fix it, except by the side effect of changing the whitespace. Is this a bug in Python 3.2? Has anyone else seen this? I don't have a 3.2 installation at hand to test it on, and I'm reluctant to change anything until I understand what's going on better. -- Greg From mattcampbell at pobox.com Sun Jan 22 03:08:22 2012 From: mattcampbell at pobox.com (Matt Campbell) Date: Sat, 21 Jan 2012 20:08:22 -0600 Subject: [Pygui] =?utf-8?q?Some_other_way_to_validate_menu_items_on_Cocoa?= =?utf-8?q?=3F?= Message-ID: I noticed that the Cocoa implementation of GUI.EditCmdHandler uses the NSMenuValidation protocol to figure out whether each of the Edit menu commands should be enabled. But the WebView class (in WebKit) doesn't implement this protocol. So can anyone figure out how WebKit indicates the current validity of Edit menu commands? I know it does, somehow, because I've written a native Cocoa app that uses WebKit, and without me paying any attention to enabling and disabling menu items, it just works as expected. Matt From drobinow at gmail.com Sun Jan 22 05:30:15 2012 From: drobinow at gmail.com (David Robinow) Date: Sat, 21 Jan 2012 23:30:15 -0500 Subject: [Pygui] Bugs in PyGUI In-Reply-To: <4F1B509C.30801@canterbury.ac.nz> References: <4F1B509C.30801@canterbury.ac.nz> Message-ID: On Sat, Jan 21, 2012 at 6:56 PM, Greg Ewing wrote: > ??? wrote: >> >> I found one small bugs in PyGUI when I run blobedit.py under python 3.2: > >> >> >> ?File "C:\Python32\lib\site-packages\GUI\GStdMenus.py", line 82 >> ? ?include = include + sum(always_include) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^ >> TabError: inconsistent use of tabs and spaces in indentation >> >> *Fix:* >> Replace line 81 in C:\Python32\lib\site-packages\GUI\GStdMenus.py: >> >> ? ?#include = include + sum(always_include) >> ? ?include = include.intersection(sum(always_include)) > > > I don't understand this. There doesn't seem to be anything wrong with > the indentation around that line in my source, and even if there was, > I don't see how the change you suggest would fix it, except by the > side effect of changing the whitespace. > > Is this a bug in Python 3.2? Has anyone else seen this? I don't have > a 3.2 installation at hand to test it on, and I'm reluctant to change > anything until I understand what's going on better. > > -- > Greg I think the OP must have caused an indentation error trying to fix the bug. I get the following (Vista PyGUI-2.5.3 Python3.2.2) Traceback (most recent call last): File "blobedit.py", line 132, in BlobApp().run() File "c:\python32\lib\site-packages\GUI\GApplications.py", line 144, in run self.menus = basic_menus() File "c:\python32\lib\site-packages\GUI\StdMenus.py", line 53, in basic_menus exclude = exclude) File "c:\python32\lib\site-packages\GUI\GStdMenus.py", line 81,in build_menus include = include + sum(always_include) TypeError: unsupported operand type(s) for +: 'set' and 'set' The demo runs with the proposed fix but it also runs using "union" rather than "intersection" which seems more appropriate for the '+' operator. But I don't really understand the code very well. Probably the correct solution is to make '+' work. I haven't tried any fix on Python 2. From jjmmma at gmail.com Sun Jan 22 06:56:31 2012 From: jjmmma at gmail.com (=?UTF-8?B?6aas5ZCJ6LuN?=) Date: Sun, 22 Jan 2012 13:56:31 +0800 Subject: [Pygui] Bugs in PyGUI In-Reply-To: References: <4F1B509C.30801@canterbury.ac.nz> Message-ID: Hi, Sorry that I copied wrong error message. The error in my previous mail is caused when I'm fixing the code. Original error is this: Traceback (most recent call last): File "C:\Users\CNKIMA\workspace\PyCAN\blobedit.py", line 132, in BlobApp().run() File "C:\Python32\lib\site-packages\GUI\GApplications.py", line 144, in run self.menus = basic_menus() File "C:\Python32\lib\site-packages\GUI\StdMenus.py", line 53, in basic_menus exclude = exclude) File "C:\Python32\lib\site-packages\GUI\GStdMenus.py", line 81, in build_menus include = include + sum(always_include) TypeError: unsupported operand type(s) for +: 'set' and 'set' The reason may be that in Python3.2, + operator is not supported anymore. So the fix is replace: include = include + sum(always_include) with include = include.intersection(sum(always_include)) BRs, Kimi ???? On Sun, Jan 22, 2012 at 12:30 PM, David Robinow wrote: > On Sat, Jan 21, 2012 at 6:56 PM, Greg Ewing > wrote: > > ??? wrote: > >> > >> I found one small bugs in PyGUI when I run blobedit.py under python 3.2: > > > >> > >> > >> File "C:\Python32\lib\site-packages\GUI\GStdMenus.py", line 82 > >> include = include + sum(always_include) > >> ^ > >> TabError: inconsistent use of tabs and spaces in indentation > >> > >> *Fix:* > >> Replace line 81 in C:\Python32\lib\site-packages\GUI\GStdMenus.py: > >> > >> #include = include + sum(always_include) > >> include = include.intersection(sum(always_include)) > > > > > > I don't understand this. There doesn't seem to be anything wrong with > > the indentation around that line in my source, and even if there was, > > I don't see how the change you suggest would fix it, except by the > > side effect of changing the whitespace. > > > > Is this a bug in Python 3.2? Has anyone else seen this? I don't have > > a 3.2 installation at hand to test it on, and I'm reluctant to change > > anything until I understand what's going on better. > > > > -- > > Greg > I think the OP must have caused an indentation error trying to fix the bug. > I get the following (Vista PyGUI-2.5.3 Python3.2.2) > Traceback (most recent call last): > File "blobedit.py", line 132, in > BlobApp().run() > File "c:\python32\lib\site-packages\GUI\GApplications.py", line 144, in > run > self.menus = basic_menus() > File "c:\python32\lib\site-packages\GUI\StdMenus.py", line 53, in > basic_menus > exclude = exclude) > File "c:\python32\lib\site-packages\GUI\GStdMenus.py", line 81,in > build_menus > include = include + sum(always_include) > TypeError: unsupported operand type(s) for +: 'set' and 'set' > > The demo runs with the proposed fix but it also runs using "union" > rather than "intersection" which seems more appropriate for the '+' > operator. But I don't really understand the code very well. Probably > the correct solution is to make '+' work. > I haven't tried any fix on Python 2. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Sun Jan 22 08:41:22 2012 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sun, 22 Jan 2012 20:41:22 +1300 Subject: [Pygui] Bugs in PyGUI In-Reply-To: References: <4F1B509C.30801@canterbury.ac.nz> Message-ID: <4F1BBDA2.2070901@canterbury.ac.nz> David Robinow wrote: > I think the OP must have caused an indentation error trying to fix the bug. > I get the following (Vista PyGUI-2.5.3 Python3.2.2) > File "c:\python32\lib\site-packages\GUI\GStdMenus.py", line 81,in build_menus > include = include + sum(always_include) > TypeError: unsupported operand type(s) for +: 'set' and 'set' Well, this is annoying. In Python 3, the set type seems to have changed so that operations on subclasses of set return plain sets, rather than instances of the subclass. I'll have to fix the CommandSet class to take this into account. -- Greg From mattcampbell at pobox.com Sun Jan 22 16:52:13 2012 From: mattcampbell at pobox.com (Matt Campbell) Date: Sun, 22 Jan 2012 09:52:13 -0600 Subject: [Pygui] =?utf-8?q?Some_other_way_to_validate_menu_items_on_Cocoa?= =?utf-8?q?=3F?= In-Reply-To: References: Message-ID: <97bef193692db3f8f61f69a2caeea89f@pobox.com> I just found the answer to my own question. The solution is to call 'validateUserInterfaceItem:'. I wonder, though, if PyGUI needs to be more hands-off here. As I mentioned in my previous post, it appears that Cocoa automatically takes care of enabling and disabling standard menu items, such as those on the Edit menu. Matt From greg.ewing at canterbury.ac.nz Sun Jan 22 22:36:51 2012 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Mon, 23 Jan 2012 10:36:51 +1300 Subject: [Pygui] Some other way to validate menu items on Cocoa? In-Reply-To: <97bef193692db3f8f61f69a2caeea89f@pobox.com> References: <97bef193692db3f8f61f69a2caeea89f@pobox.com> Message-ID: <4F1C8173.5030508@canterbury.ac.nz> Matt Campbell wrote: > I just found the answer to my own question. The solution is to call > 'validateUserInterfaceItem:'. > > I wonder, though, if PyGUI needs to be more hands-off here. As I > mentioned in my previous post, it appears that Cocoa automatically takes > care of enabling and disabling standard menu items, such as those on the > Edit menu. The problem is that PyGUI has its own way of handling the enabling of menu items, and somehow this needs to be made to dovetail with what Cocoa does. For example, the user should be able to create a subclass of TextField and override its setup_menus() method to modify the conditions for enabling edit commands. The only way I can think of to make that possible is to intercept Cocoa's attempts to find out which commands to enable, funnel them through the setup_menus mechanism, and then call the appropriate underlying Cocoa methods from the setup_menus methods. -- Greg From amorris at mistermorris.com Tue Jan 24 06:01:49 2012 From: amorris at mistermorris.com (Adam Morris) Date: Tue, 24 Jan 2012 13:01:49 +0800 Subject: [Pygui] documenation In-Reply-To: References: Message-ID: <5861E473-7FBD-4C61-8866-EBC1A91A477F@mistermorris.com> I noticed that pygui isn't on pythonpackages.com, nor on readthedocs.org. With other packages, I quickly get frustrated with a lack of documentation ? might it be worth having a larger footprint? -Adam From babylakshmi at ibioinformatics.org Sat Jan 28 09:06:17 2012 From: babylakshmi at ibioinformatics.org (Babylakshmi Muthusamy) Date: Sat, 28 Jan 2012 02:06:17 -0600 Subject: [Pygui] stand alone tool Message-ID: <442e6fcade57e408068e1d43e2d216b4.squirrel@mail.ibioinformatics.org> Hi, I am new to python GUI. Could any one help me whether we can develop stand alone tools using python GUI modules? If yes, Could you tell me how to go about it and which are the modules are being used for that purpose. If possible, please send tutorial and installation links. Thanks, Babylakshmi