You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(116) |
Sep
(146) |
Oct
(78) |
Nov
(69) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(188) |
Feb
(142) |
Mar
(143) |
Apr
(131) |
May
(97) |
Jun
(221) |
Jul
(127) |
Aug
(89) |
Sep
(83) |
Oct
(66) |
Nov
(47) |
Dec
(70) |
2003 |
Jan
(77) |
Feb
(91) |
Mar
(103) |
Apr
(98) |
May
(134) |
Jun
(47) |
Jul
(74) |
Aug
(71) |
Sep
(48) |
Oct
(23) |
Nov
(37) |
Dec
(13) |
2004 |
Jan
(24) |
Feb
(15) |
Mar
(52) |
Apr
(119) |
May
(49) |
Jun
(41) |
Jul
(34) |
Aug
(91) |
Sep
(169) |
Oct
(38) |
Nov
(32) |
Dec
(47) |
2005 |
Jan
(61) |
Feb
(47) |
Mar
(101) |
Apr
(130) |
May
(51) |
Jun
(65) |
Jul
(71) |
Aug
(96) |
Sep
(28) |
Oct
(20) |
Nov
(39) |
Dec
(62) |
2006 |
Jan
(13) |
Feb
(19) |
Mar
(18) |
Apr
(34) |
May
(39) |
Jun
(50) |
Jul
(63) |
Aug
(18) |
Sep
(37) |
Oct
(14) |
Nov
(56) |
Dec
(32) |
2007 |
Jan
(30) |
Feb
(13) |
Mar
(25) |
Apr
(3) |
May
(15) |
Jun
(42) |
Jul
(5) |
Aug
(17) |
Sep
(6) |
Oct
(25) |
Nov
(49) |
Dec
(10) |
2008 |
Jan
(12) |
Feb
|
Mar
(17) |
Apr
(18) |
May
(12) |
Jun
(2) |
Jul
(2) |
Aug
(6) |
Sep
(4) |
Oct
(15) |
Nov
(45) |
Dec
(9) |
2009 |
Jan
(1) |
Feb
(3) |
Mar
(18) |
Apr
(8) |
May
(3) |
Jun
|
Jul
(13) |
Aug
(2) |
Sep
(1) |
Oct
(9) |
Nov
(13) |
Dec
|
2010 |
Jan
(2) |
Feb
(3) |
Mar
(9) |
Apr
(10) |
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(4) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(44) |
May
(9) |
Jun
(22) |
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(3) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Tony C. <cap...@gm...> - 2007-12-24 08:27:55
|
Message: 4 Date: Tue, 18 Dec 2007 13:07:17 +0100 From: Christoph Schneeberger <cs...@bo...> Subject: [Pythoncard-users] book / reading mat. recommendations To: pyt...@li... Message-ID: <476...@bo...> Content-Type: text/plain; charset=ISO-8859-1 I second that recommendation on WxPython In Action. It's very well written, and is invaluable if you want to use wx with or without Pythoncard. Put it on your list ASAP!!!!!!!!! |
From: Tony C. <cap...@gm...> - 2007-12-24 08:25:47
|
If you're using Python 2.5 or later, try using the subprocess module. It has replacements for popen, and os.system and others I'm calling both an exe and a python script from a Pythoncard app using subprocess, and I am easily capturing stdout and stderr. The subprocess module makes this very easy Message: 1 Date: Mon, 03 Dec 2007 23:42:34 +0000 From: Alex Tweedly <al...@tw...> Subject: Re: [Pythoncard-users] Executing python scripts from a python program. To: "Hedlund, Peter" <phe...@te...> Cc: "'pyt...@li...'" <pyt...@li...> Message-ID: <475...@tw...> Content-Type: text/plain; charset="iso-8859-1" |
From: Tony C. <cap...@gm...> - 2007-12-24 08:20:36
|
I'm trying to get my app to always start in the same position each time I run it, instead of some random position. However, the method I've used in other programs doesn't seem to apply in Pythoncard I get the screen width & screen height as follows from win32api import GetSystemMetrics SM_CXSCREEN = 0 SM_CYSCREEN = 1 #self.ScreenWidth = GetSystemMetrics (SM_CXSCREEN) #self.ScreenHeight = GetSystemMetrics (SM_CYSCREEN) then self.position[0] = (self.ScreenWidth - self.size[0]) / 2 self.position[1] = (self.ScreenHeight - self.size[1]) / 2 However, Pythoncard seems ot be overwriting the values I put in self.position. Would someone show me a better way to center a pythoncard app on startup? Merry Christmas Everyone! |
From: Sean K. F. <skf...@gm...> - 2007-12-18 14:47:35
|
Greetings, Christoph. Now my problem is that, the jump from writing PythonCard apps with the > help of the online documentation and the fine PythonCard tools to > understanding the wxPython docs seems way too broad for me to take. So I > am wondering what others did to close this gap, is there a nice > tutorial, an excellent book to read etc. ? I mean wx resp. wxPython > seems to me the way to go but I am having an extremly hard time learning > it. I have found a few books on amazon, but only 'wxPython in Action' > seems dedicated to my topic in question and I dont wan't a general > cookbook with a chapter on wxPython because I think that wouldn't help > me much. I'd recommend "wxPython in Action". It is the only reading I've found dedicated to the subject. Noel and Robin do a great job explaining everything. Robin Dunn created wxPython, after all. ;) I must add though, that you may still spend some time Googling to complete your creations in wxPython/Pythoncard, but this book is a solid prerequisite to those interested in taking their Pythoncard applications further, or those interested in developing pure wxPython apps. > > > Naturally the way I'd really like it to be is that PythonCard completely > wraps all those nifty wx-components I'm dreaming of to use like the > above ones... but I realize there sure are reasons why this is not done, > be it even lack of time or motivation or technical issues or that the > component may not be simplified enough to justify the wrapping, etc. > Also I guess that just shifts the point where you have to deal with wx > directly a bit into the future. I don't know, however I tasted blood and > I want the meat now (full blown cross platform gui apps with all bells > and whistles) ;-) Understood. Pythoncard is an elegant, managable approach to cross-platform application development, but the need exists for deeper knowledge of wxPython itself once you move beyond the stock UI components supported by default. At the moment, this appears to be par for the course. > > > Thanks for any reading recommendations and tips, > Christoph > > -- > > > "Quis custodiet ipsos custodes?" > > |
From: Christoph S. <cs...@bo...> - 2007-12-18 12:07:43
|
Hi, I've been playing and working with PythonCard quite a time now and I still love it. However there is a certain point when one has to start dealing with wxPython resp. wx , say if you want a bit more from a the ListCtrl, Notebook or from TreeCtrl or even use sizer. Now my problem is that, the jump from writing PythonCard apps with the help of the online documentation and the fine PythonCard tools to understanding the wxPython docs seems way too broad for me to take. So I am wondering what others did to close this gap, is there a nice tutorial, an excellent book to read etc. ? I mean wx resp. wxPython seems to me the way to go but I am having an extremly hard time learning it. I have found a few books on amazon, but only 'wxPython in Action' seems dedicated to my topic in question and I dont wan't a general cookbook with a chapter on wxPython because I think that wouldn't help me much. Naturally the way I'd really like it to be is that PythonCard completely wraps all those nifty wx-components I'm dreaming of to use like the above ones... but I realize there sure are reasons why this is not done, be it even lack of time or motivation or technical issues or that the component may not be simplified enough to justify the wrapping, etc. Also I guess that just shifts the point where you have to deal with wx directly a bit into the future. I don't know, however I tasted blood and I want the meat now (full blown cross platform gui apps with all bells and whistles) ;-) Thanks for any reading recommendations and tips, Christoph -- "Quis custodiet ipsos custodes?" |
From: Tony C. <cap...@gm...> - 2007-12-04 08:27:43
|
When I run my app after building a py2exe app with this command line python setup.py py2exe -b1 -c My app crashes on startup, but does not make a .log file. The dialog displays Microsoft Visual C++ Runtime Library "Runtime Error!" "The application requested that the Runtime terminate it in an unusual way" When I change the build line to python setup.py py2exe -c My app launches just fine, but then there is a directory full of many dlls and pyds. setup.py looks like this from distutils.core import setup import py2exe setup(windows=['WxGui.py'], zipfile=None) Why does my app crash when it is built one way, but not the other? thanks |
From: Andrew T. <an...@ha...> - 2007-12-04 07:37:38
|
Rachid Manseur wrote: > Hello Andy: > > Thanks for your help. I have taken a fast look and will look in more > details at the sample you suggest. > With my level of python knowledge however, it feels like someone told me > to look at a car because I > asked a question about motors. I have no knowledge of data bases > whatsoever so I am unable to > even run the sample code. :) > Is there any documentation or tutorial that you know about this topic? > Thanks again. > > Rachid > > > [snip] > > Not really a tutorial but if you look at the on_btnBrowse_mouseClick method of the DbBrowser class in the dbBrowser.py module stored in the samples/dbBrowser directory of your PythonCard installation you can see the code I mentioned. This takes the definition of the columns in a database table (provided by the call to self._database.getColumns on line 106 and creates two widgets for each one; one to show the contents and another as a label. The code you are interested in is on lines 114 and 122 where the new widgets are defined and then lines 118 and 127 where the widgets are added to the current components. You should be able to take one pair of these and copy them to your code to start experimenting, something like; def on_something(self, event): "Add a new widget to my background" new_widget = {'type': 'StaticText', 'name': 'my_new_widget', 'position': (100, 100), 'text': 'Welcome to my new widget'} self.components[new_widget['name']] = new_widget Then link that command to something and you should be away. Regards, Andy -- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |
From: Alex T. <al...@tw...> - 2007-12-03 23:42:18
|
Hedlund, Peter wrote: > > Greetings, > > I am in need of some assistance on this one. > > I want the user to be able to edit a python script file and allow that > script to be run from within my main python program. > > Now before everyone jumps on the execfile bandwagon I need to clarify > some things. > > > > The main python program has several other python scripts in the project. > > I am using pythoncard for my user ide. > > The user script will need to call functions already defined in the > main.py and pass information back to main.py. > > > > Main program opens a serial port to a device > > User script will send commands to the device by way of functions in main > > > > Any ideas on this would be appreciated. > > > Probably being naive, but .... Can't you simply do an eval() of the user script ? -- Alex Tweedly mailto:al...@tw... www.tweedly.net |
From: Hedlund, P. <phe...@te...> - 2007-12-03 15:46:42
|
Greetings, I am in need of some assistance on this one. I want the user to be able to edit a python script file and allow that scri= pt to be run from within my main python program. Now before everyone jumps on the execfile bandwagon I need to clarify some = things. The main python program has several other python scripts in the project. I am using pythoncard for my user ide. The user script will need to call functions already defined in the main.py = and pass information back to main.py. Main program opens a serial port to a device User script will send commands to the device by way of functions in main Any ideas on this would be appreciated. Peter Hedlund Senior Software Engineer Direct: 847-406-5271 phe...@te...<mailto:phe...@te...> TECNOVA 1486 St. Paul Avenue Gurnee, IL 60031 USA Phone: 847-662-6260 www.tecnova.com<http://www.tecnova.com/> |
From: Tony C. <cap...@gm...> - 2007-11-29 23:20:49
|
I've got two identically-sized textarea widgets. I want to synchronize both horizontal and vertical scrolling if this is possible. That is, when the user scrolls on either scrollbar on the left widget, the widget on the right will scroll by the same amount. Looking at the message watcher, I don't see any messages displayed when I scroll on the vertical or horizontal scrollbar. I would also like to synchronize the selecting (highlighting) of any line, between the two textarea widgets. That is, when the user selects a line on the left widget, that same line will be displayed at the same position in the right texarea widget, and highlighted as well. At the moment, I have to doubleclick on the text 3 times in the textarea widgets, before the entire line is highlighted. This is very undesireable. The example demos don't appear to have this kind of functionality. Suggestions anyone? |
From: Andrew T. <an...@ha...> - 2007-11-28 09:36:35
|
Rachid Manseur wrote: > Hello, > > I am planning to convert software from VB6 to Python (PythonCard) and I > am a new learner of python. Is there a way to create a GUI dynamically > depending on user input? For example if a user enters the number 5 in > an initial GUI, a second GUI is generated that has 5 lines of buttons, > textfields, etc. In VB6, arrays of controls offered a possibility. How > about python? > > My objective is to offer a data entry table and check boxes for the > user. The dimensions of the table and the number of buttons depend on > the user's needs. The multiColumnList component sounds like a > possibility. Where can I find details on how to use it efficiently? > > Thanks for any help. > > Rachid Manseur > > rma...@gm... <mailto:rma...@gm...> > Take a look at the dbBrowser sample. All of the widgets in it are created dynamically. Regards, Andy -- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |
From: Rachid M. <rma...@gm...> - 2007-11-27 17:32:45
|
Hello, I am planning to convert software from VB6 to Python (PythonCard) and I am a new learner of python. Is there a way to create a GUI dynamically depending on user input? For example if a user enters the number 5 in an initial GUI, a second GUI is generated that has 5 lines of buttons, textfields, etc. In VB6, arrays of controls offered a possibility. How about python? My objective is to offer a data entry table and check boxes for the user. The dimensions of the table and the number of buttons depend on the user's needs. The multiColumnList component sounds like a possibility. Where can I find details on how to use it efficiently? Thanks for any help. Rachid Manseur rma...@gm... |
From: Brian D. <deb...@ho...> - 2007-11-21 02:17:14
|
# This is an example setup.py file # run it from the windows command line like so: #> C:\Python2.4\python.exe setup.py py2exe =20 from distutils.core import setup from Common import * =20 import py2exe, shutil, os # extra files/dirs copied to the project extra_data =3D ['data','gfx','conf','help','pyPlan.rsrc.py','pyEstados.rsrc= .py','Parametros.rsrc.py','ParamFin.rsrc.py','pyPlan.exe.manifest'] opts =3D {=20 "py2exe": {=20 # if you import .py files from subfolders of your project, then those ar= e # submodules. You'll want to declare those in the "includes" "compressed": 1, "optimize": 2, "includes":[] }=20 }=20 =20 setup( version =3D APP_VERSION, description =3D APP_DESC, name =3D APP_NAME, author =3D APP_AUTHOR, =20 #this is the file that is run when you start the game from the command li= ne. =20 windows=3D[{"script": "pyPlan.py","icon_resources": [(1, "pyplan.ico")]}]= , #options as defined above options=3Dopts, #data files - these are the non-python files, like images and sounds #the glob module comes in handy here. #data_files =3D [], =20 #this will pack up a zipfile instead of having a glut of files sitting #in a folder. zipfile=3D"lib/shared.zip" ) #also need to hand copy the extra files here def installfile(name): dst =3D os.path.join('dist') print 'copying', name, '->', dst if os.path.isdir(name): dst =3D os.path.join(dst, name) if os.path.isdir(dst): shutil.rmtree(dst) shutil.copytree(name, dst) elif os.path.isfile(name): shutil.copy(name, dst) else: print 'Warning, %s not found' % name for data in extra_data: installfile(data) _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Space= s. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=3Dcreate&wx_url=3D/friends.= aspx&mkt=3Den-us= |
From: Kevin A. <al...@se...> - 2007-11-20 21:55:23
|
On Nov 20, 2007, at 9:44 AM, Tony Cappellini wrote: > Thanks, but unfortunately, we have requirements where I work to use > py2exe for all projects > Standalonebuilder supports py2exe. In addition, minimalStandalone and other samples and tools have examples of using py2exe. You may also want to search this topic in the archives, just follow the links from the PythonCard home page to the archives and then do a search. ka |
From: Tony C. <cap...@gm...> - 2007-11-20 17:44:14
|
Thanks, but unfortunately, we have requirements where I work to use py2exe for all projects On Nov 20, 2007 1:43 AM, tjerk hoekstra <tj...@br...> wrote: > Try using standalonebuilder..it takes care of all these details. > > > ----- Original Message ----- > From: "Tony Cappellini" <cap...@gm...> > To: <pyt...@li...> > Sent: Tuesday, November 20, 2007 12:24 AM > Subject: [Pythoncard-users] py2exe (setup.py) for pythoncard apps > > > > I've used py2exe for several command-line apps before, but not for a > > Pythoncard app. > > > > Would someone post the contents of setup.py for a Pythoncard app? > > > > How do you get py2exe to put the script.rsrc.py file inside the .exe ? > > > > thanks > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Pythoncard-users mailing list > > Pyt...@li... > > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > > |
From: Phil E. <ph...@li...> - 2007-11-20 09:46:27
|
Tony Cappellini wrote: > I've used py2exe for several command-line apps before, but not for a > Pythoncard app. > > Would someone post the contents of setup.py for a Pythoncard app? > > How do you get py2exe to put the script.rsrc.py file inside the .exe ? > Hi Tony: Take a look at the standaloneBuilder tool which comes with the PythonCard distribution. My brief notes on the process of converting PythonCard apps to executables can be found here: http://pythoncard.sourceforge.net/standalone.html Although this is based around using pyInstaller, the standaloneBuilder app supports py2exe as well. I've attached copies of the setup.py and associated data files that standaloneBuilder generates for a py2exe build, hope this helps. Essentially, the resource files stay as they are, i.e. they don't get packed into the EXE in any way. I've often thought it would be useful to write some sort of helper class which would allow resource files to be bundled up into a module that the app could import, along similar lines to the img2py stuff which comes with the wxPython demo. -- Regards Phil Edwards Brighton, UK |
From: tjerk h. <tj...@br...> - 2007-11-20 09:43:32
|
Try using standalonebuilder..it takes care of all these details. ----- Original Message ----- From: "Tony Cappellini" <cap...@gm...> To: <pyt...@li...> Sent: Tuesday, November 20, 2007 12:24 AM Subject: [Pythoncard-users] py2exe (setup.py) for pythoncard apps > I've used py2exe for several command-line apps before, but not for a > Pythoncard app. > > Would someone post the contents of setup.py for a Pythoncard app? > > How do you get py2exe to put the script.rsrc.py file inside the .exe ? > > thanks > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > |
From: Tony C. <cap...@gm...> - 2007-11-20 02:24:55
|
I've used py2exe for several command-line apps before, but not for a Pythoncard app. Would someone post the contents of setup.py for a Pythoncard app? How do you get py2exe to put the script.rsrc.py file inside the .exe ? thanks |
From: Tony C. <cap...@gm...> - 2007-11-18 08:05:34
|
After editing the FG colors on all of the StaticBoxes in my program with the Resource Property Editor, clicking update, and then saving with File/Save, the color changes do not show up when I run the program. These changes are not saved to the resource file either. Has anyone else had this problem?? |
From: <nac...@gm...> - 2007-11-18 04:56:57
|
Hi list, Is it possible to attach a timer to a menu item??? When you attach a timer to a widget, you need to pass the widget name like this: "*self.aWidgetTimer = timer.Timer(self.components.Widget, -1)*". So, if the answer to my question is Yes (which I hope), how the menu is passed to the timer??? Thanks in advance... Raul |
From: Tony C. <cap...@gm...> - 2007-11-17 17:37:17
|
I've found the problem. My call to wx.SafeYield() didn't include self (which is an instance of the GUI class) When I changed the call to wx.SafeYield(self) the GUI no longer freezes while class2 is processing files. thanks On Nov 17, 2007 8:41 AM, Kevin Altis <al...@se...> wrote: > In general, you can't do anything long running in an event handler or > it will lock your program up as you found. In your case, you should > take a look at some of the samples and documentation that cover the > Python thread and Queue modules. Queue is guaranteed to be thread- > safe so that is what you use to communicate between your GUI thread > and the thread that is during your long-running work. > > http://pythoncard.sourceforge.net/timers-threads.html > > Samples that use threads are: chat, jabberChat, webgrabber, and > webserver. > > You'll probably find doing some searches for code snippets and topics > with the findfiles tool useful. > > http://pythoncard.sourceforge.net/findfiles.html > > Simply set the directory to search to your copy of PythonCard and > then look for appropriate topics like thread and Queue. > > ka > > > On Nov 16, 2007, at 4:17 PM, Tony Cappellini wrote: > > > I've got 2 classes in my Pythoncard program. > > > > The GUI is handled in class1 and some file processing is handled in > > class2. > > > > Class2 executes an external program in a thread, and loops waiting for > > the thread to finish. > > In that loop, I call a method in class1 which calls wx.safeYield(). > > > > The external program is processing some text files, and the GUI lets > > the user choose which files to process and passes those files as args > > to the external program. > > > > While the gui is looping passing a new filename to the program, my > > Pythoncard GUI is unresponsive. That is, I cannot move it with the > > mouse, nor maximize/minimize it. > > > > Class1 passes a callback to class2 to allow class2 to execute a > > callback which calls wx.SafeYield. That callback can be seen below > > (guiCallback) > > > > This is the method in class2 which executes the external program, > > in a thread > > > > threadHandle = ManagedThread(ExecutePipedCommand, cmdLine) > > > > while not threadHandle.IsDone(): > > guiCallback() > > time.sleep(.10) > > > > > > ExecutePipedCommand() is just a wrapper class for os.popen() > > ManagedThread() is just a wrapper for the functionality in the > > threading module > > > > How should I proceed to keep my pythoncard gui from freezing? > > > > Thanks > > > |
From: Kevin A. <al...@se...> - 2007-11-17 16:41:44
|
In general, you can't do anything long running in an event handler or it will lock your program up as you found. In your case, you should take a look at some of the samples and documentation that cover the Python thread and Queue modules. Queue is guaranteed to be thread- safe so that is what you use to communicate between your GUI thread and the thread that is during your long-running work. http://pythoncard.sourceforge.net/timers-threads.html Samples that use threads are: chat, jabberChat, webgrabber, and webserver. You'll probably find doing some searches for code snippets and topics with the findfiles tool useful. http://pythoncard.sourceforge.net/findfiles.html Simply set the directory to search to your copy of PythonCard and then look for appropriate topics like thread and Queue. ka On Nov 16, 2007, at 4:17 PM, Tony Cappellini wrote: > I've got 2 classes in my Pythoncard program. > > The GUI is handled in class1 and some file processing is handled in > class2. > > Class2 executes an external program in a thread, and loops waiting for > the thread to finish. > In that loop, I call a method in class1 which calls wx.safeYield(). > > The external program is processing some text files, and the GUI lets > the user choose which files to process and passes those files as args > to the external program. > > While the gui is looping passing a new filename to the program, my > Pythoncard GUI is unresponsive. That is, I cannot move it with the > mouse, nor maximize/minimize it. > > Class1 passes a callback to class2 to allow class2 to execute a > callback which calls wx.SafeYield. That callback can be seen below > (guiCallback) > > This is the method in class2 which executes the external program, > in a thread > > threadHandle = ManagedThread(ExecutePipedCommand, cmdLine) > > while not threadHandle.IsDone(): > guiCallback() > time.sleep(.10) > > > ExecutePipedCommand() is just a wrapper class for os.popen() > ManagedThread() is just a wrapper for the functionality in the > threading module > > How should I proceed to keep my pythoncard gui from freezing? > > Thanks > |
From: Tony C. <cap...@gm...> - 2007-11-17 05:23:05
|
> The message watcher only shows the following events being triggered: > > mouseDown > textUpdate > mouseUp > mouseMove > Thanks for that tip I didn't know about the message watcher before. |
From: Tony C. <cap...@gm...> - 2007-11-17 00:17:50
|
I've got 2 classes in my Pythoncard program. The GUI is handled in class1 and some file processing is handled in class2. Class2 executes an external program in a thread, and loops waiting for the thread to finish. In that loop, I call a method in class1 which calls wx.safeYield(). The external program is processing some text files, and the GUI lets the user choose which files to process and passes those files as args to the external program. While the gui is looping passing a new filename to the program, my Pythoncard GUI is unresponsive. That is, I cannot move it with the mouse, nor maximize/minimize it. Class1 passes a callback to class2 to allow class2 to execute a callback which calls wx.SafeYield. That callback can be seen below (guiCallback) This is the method in class2 which executes the external program, in a thread threadHandle = ManagedThread(ExecutePipedCommand, cmdLine) while not threadHandle.IsDone(): guiCallback() time.sleep(.10) ExecutePipedCommand() is just a wrapper class for os.popen() ManagedThread() is just a wrapper for the functionality in the threading module How should I proceed to keep my pythoncard gui from freezing? Thanks |
From: Sean K. F. <skf...@gm...> - 2007-11-15 22:13:33
|
I can't help but wonder... If you are indeed populating the text control with a list of filenames yourself, why not increment a counter while you build this list and cache that number off for later reference? Better yet, why not populate a list (list object, not list control) and use that for the basis of the content within text control? You can then leverage the full capabilities of the list object and every time it is updated, simply reference some "redraw" routine to populate the text control with the current contents of the list? Personally, I do not recommend relying on the control to return what's in it, or how many of something it contains, you should begin thinking about how you can abstract that data out to your code and manage it at the application level, rather than the view/UI level, and only use the UI to display the underlying application data... If that makes any sense... - Sean On Nov 15, 2007 4:40 PM, Kevin Altis <al...@se...> wrote: > > On Nov 15, 2007, at 1:05 PM, Tony Cappellini wrote: > > >> self.components.yourComponentNameHere.getNumberOfLines() should work. > > > >> If it doesn't, then I would like to know what the line endings are as > >> well as which platform and versions of wxPython and PythonCard you're > >> using. > > > > The platform is Windows > > The line endings are "\n" > > > > Wx version 2.8.4.2 > > Pythoncard version is the latest 0.8.2 > > > > > > I've just tried this again today- while verifying the line endings, > > and getNumberOfLines() is returning a valid number instead of 1 > > > > I'll keep watching this to see if it changes > > After looking at the documentation again for the wx.TextCtrl > (TextArea is based on that widget) method GetNumberOfLines, I would > avoid using it to count lines if you want to be consistent in your > results across platforms. Here's the excerpt from the docs... > > """ > wxTextCtrl::GetNumberOfLines > int GetNumberOfLines() const > > Returns the number of lines in the text control buffer. > > Remarks > > Note that even empty text controls have one line (where the insertion > point is), so GetNumberOfLines() never returns 0. > > For gtk_text (multi-line) controls, the number of lines is calculated > by actually counting newline characters in the buffer. You may wish > to avoid using functions that work with line numbers if you are > working with controls that contain large amounts of text. > """ > > In addition I noticed that the result returned on Windows was > actually the wrapped line count, not the number of newlines. So a > safer, more consistent result would be to get a count with something > like... > > len(self.components.myTextArea.text.split('\n')) > > ka > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- Thanks! Sean Sean K. Friese skf...@gm... This email message, including any attachment(s) hereto, is intended only for the addressee and may contain information that is legally privileged, confidential and/or exempt from disclosure under applicable law. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you have received this communication in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message. |