On Fri, Jul 18, 2008 at 2:53 PM, Wesley Nitsckie <[email protected]>
wrote:
> Hi All,
>
> Anyone have some tips on how to create a thread. I am connecting to
> a server. So while that is happenining I want to run a progress bar until
> the connection stuff is completed.
>
> Thanks
> Wesley
>
ps .. I just need the thread part . I have the bit to do the progress bar
and the connection stuff
<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Jul 18, 2008 at 2:53 PM, Wesley Nitsckie <<a href="mailto:wesleynitsckie@gmail.com">wesleynitsckie@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hi All,<br><br>Anyone have some tips on how to create a thread. I am connecting to <br>a server. So while that is happenining I want to run a progress bar until<br>the connection stuff is completed.<br><br>
Thanks<br>Wesley<br></div>
</blockquote></div><br>ps .. I just need the thread part . I have the bit to do the progress bar and the connection stuff<br></div>
_______________________________________________
wxpython-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Hi,
On Fri, Jul 18, 2008 at 2:54 PM, Wesley Nitsckie <[email protected]>
wrote:
>
>
> On Fri, Jul 18, 2008 at 2:53 PM, Wesley Nitsckie <[email protected]>
> wrote:
>
>> Hi All,
>>
>> Anyone have some tips on how to create a thread. I am connecting to
>> a server. So while that is happenining I want to run a progress bar until
>> the connection stuff is completed.
>>
>> Thanks
>> Wesley
>>
>
> ps .. I just need the thread part . I have the bit to do the progress bar
> and the connection stuff
>
There's nothing hard about threading, really.
Code below is not intended to actually work, it is just pseudo-code which I
typed in my mail editor, but should show you the idea.
---- pseudo-code starts ----
from threading import Thread
import wx
# ... Make your progress-bar, WX windows, etc
def init_wx_ap():
pass
def a_method(prog_bar, arg1, arg2):
do_some_work()
wx.CallAfter(prog_bar, value1)
do_some_work()
wx.CallAfter(prog_bar, value2)
do_more_work()
wx.CallAfter(prog_bar, value3)
return
t = Thread(target=a_method, args=(my_prog_bar, arg1, arg2))
t.start()
---- pseudo-code ended ----
See also further examples on:
http://www.wellho.net/solutions/python-python-threads-a-first-example.html
Cheers,
--Tim
<div dir="ltr">Hi,<br><br><div class="gmail_quote">On Fri, Jul 18, 2008 at 2:54 PM, Wesley Nitsckie <<a href="mailto:wesleynitsckie@gmail.com">wesleynitsckie@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Fri, Jul 18, 2008 at 2:53 PM, Wesley Nitsckie <<a href="mailto:wesleynitsckie@gmail.com" target="_blank">wesleynitsckie@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hi All,<br><br>Anyone have some tips on how to create a thread. I am connecting to <br>a server. So while that is happenining I want to run a progress bar until<br>the connection stuff is completed.<br><br>
Thanks<br>Wesley<br></div>
</blockquote></div><br></div></div>ps .. I just need the thread part . I have the bit to do the progress bar and the connection stuff<br></div>
</blockquote><div><br><br>There's nothing hard about threading, really.<br><br>Code below is not intended to actually work, it is just pseudo-code which I typed in my mail editor, but should show you the idea.<br><br>
---- pseudo-code starts ----<br>from threading import Thread<br>import wx<br><br># ... Make your progress-bar, WX windows, etc<br>def init_wx_ap():<br> pass<br><br>def a_method(prog_bar, arg1, arg2):<br> do_some_work()<br>
wx.CallAfter(prog_bar, value1)<br> do_some_work()<br></div></div> wx.CallAfter(prog_bar, value2)<br>
do_more_work()<br> wx.CallAfter(prog_bar, value3)<br> return<br><br>t = Thread(target=a_method, args=(my_prog_bar, arg1, arg2))<br>t.start()<br><br>---- pseudo-code ended ----<br><br><br>See also further examples on: <br>
<a href="
http://www.wellho.net/solutions/python-python-threads-a-first-example.html">http://www.wellho.net/solutions/python-python-threads-a-first-example.html</a><br><br>Cheers,<br><br>--Tim<br><br></div>
_______________________________________________
wxpython-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users