Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'configure': 0.05; 'subject:file': 0.07; 'sys': 0.07; '"__main__":': 0.09; '__name__': 0.09; 'deploy': 0.09; 'image,': 0.09; 'indeed,': 0.09; 'working:': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'def': 0.12; 'gui': 0.12; '(when': 0.16; 'buttons,': 0.16; 'interval,': 0.16; 'interval.': 0.16; 'stuff.': 0.16; 'subject:access': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'app': 0.19; 'working.': 0.19; 'import': 0.22; '(in': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'tue': 0.24; 'decide': 0.24; 'fairly': 0.24; 'cc:2**0': 0.24; '>': 0.26; 'nearly': 0.26; 'defined': 0.27; 'testing': 0.29; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'getting': 0.31; 'operations.': 0.31; 'skip:q 20': 0.31; "user's": 0.31; 'skip:m 30': 0.32; 'interface': 0.32; 'url:python': 0.33; 'proceed': 0.33; 'sense': 0.34; 'maybe': 0.34; 'subject:from': 0.34; 'basic': 0.35; 'info': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'right?': 0.36; 'url:listinfo': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'two': 0.37; 'being': 0.38; 'christian': 0.38; 'configured': 0.38; 'nov': 0.38; 'skip:m 40': 0.38; 'little': 0.38; 'skip:& 20': 0.39; 'either': 0.39; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'balance': 0.61; 'traffic': 0.61; 'simple': 0.61; "you're": 0.61; 'complete': 0.62; 'pick': 0.64; 'talking': 0.65; 'to:addr:gmail.com': 0.65; 'within': 0.65; 'periodically': 0.68; '5:15': 0.84; 'etc,': 0.84; 'locked': 0.84; 'mistaken': 0.84; 'working,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to:cc :content-type; bh=Ga2ek/+6RQFyVKaAFpa0pUqFVSyTr2dnCDbtSSAIyIo=; b=mgcPVL2q1BpRPDITvH5DPXLbaRhuL+4Yip8yscYA6cRLhXoAurk5sKnJwX75xSFcrs ZW8O9BnW/uBaHnhlycPT6v7P+MnDhOHbejRlcff7P8fyDT8ifBiTVtYgHSBlJ/ZInCbV HlzA7lhC/BS31qFxTl6pB/NymOENIYhx4U0n+epxOUw+EWF8c22q+OHLl7MdHtwuXafq /mQr4dlAZG+n69KCqrBYBsNsTB8UsEb71Ktv5du+FNf29WxCBSG/hea+FD0JBQJi0WtJ NgkBghO++oyna36dcRVfPhAmPDVHMK+SL/XsS1bHTegp2floHfEo0czK9eIUxHwMo8bZ fzNg== X-Received: by 10.140.30.33 with SMTP id c30mr27110697qgc.32.1416430052355; Wed, 19 Nov 2014 12:47:32 -0800 (PST) MIME-Version: 1.0 References: <546B3FE4.3050204@telenet.be> <546B6A4B.90107@telenet.be> From: Juan Christian Date: Wed, 19 Nov 2014 20:47:31 +0000 Subject: Re: How to access Qt components loaded from file? To: Chris Angelico Content-Type: multipart/alternative; boundary=001a113aac4e1eb6d805083c52a9 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 122 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416430060 news.xs4all.nl 2926 [2001:888:2000:d::a6]:58431 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81040 --001a113aac4e1eb6d805083c52a9 Content-Type: text/plain; charset=UTF-8 Let's say that I want to call the site in a 5min interval. I'm currently getting the info this way just for testing and to know that the 'core engine' is working, and indeed, it's working: if __name__ == "__main__": import sys app = QApplication(sys.argv) MainWindow = loadui("main.ui") def output_slot(): MainWindow.txtbox.setText(call_site()) MainWindow.btn.clicked.connect(output_slot) MainWindow.show() app.exec_() How can I proceed if I want the txtbox to automatically do the 'setText(call_site())' in a X defined interval? The final app will have not only a txtbox, but a complete interface with buttons, avatar image, some txtboxes, and all that stuff. If I know how to "call the site" in a defined interval, I can get all the info that I need and set them one by one. If I'm not mistaken my app is locked in the app.exec_() loop, so I need to have a trigger configured that will be called in a defined interval, then inside this trigger I configure the "set_avatar", "set_text", "set_btn_link", etc, is that right? On Tue Nov 18 2014 at 9:37:21 PM Chris Angelico wrote: > On Wed, Nov 19, 2014 at 5:15 AM, Juan Christian > wrote: > > > > Thanks, it's working. What would be a "professional" approach if I want > to > > constantly call a URL to get it's content and access this data within the > > GUI? > > > > "Constantly" doesn't make much sense when you're talking about network > operations. There are two basic approaches: either you re-fetch > periodically and update the GUI (in which case you have to decide how > frequently), or you re-fetch on some trigger (when it's changed, or > when the user's about to need it, or something). Either way, you have > to balance network traffic versus promptness of update, and it's > nearly impossible to pick perfectly. But if you don't mind it being a > little clunky, you should be able to pick something fairly simple and > deploy it, and then maybe refine it a bit afterward. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > --001a113aac4e1eb6d805083c52a9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Let's say that I want to call the site in a 5min=C2=A0interval. I'm= currently getting the info this way just for testing and to know that the = 'core engine' is working, and indeed, it's working:

if __name__ =3D=3D "__main__":
import sys

=
app =3D QApplication= (sys.argv)
MainWindo= w =3D loadui("main.ui")

def output_slot():
MainWindow.txtbox.setText(call_site= ())

M= ainWindow.btn.clicked.connect(output_slot)

MainWindow.show()
app.exec_()

<= div>How can I proceed if I want the txtbox to automatically do the 'set= Text(call_site())' in a X defined interval? The final app will have not= only a txtbox, but a complete interface with buttons, avatar image, some t= xtboxes, and all that stuff.=C2=A0If I know= how to "call the site" in a defined interval, I can get all the = info that I need and set them one by one.

I= f I'm not mistaken my app is locked in the=C2=A0app.exec_() loop, so I = need to have a trigger configured that will be called in a defined interval= , then inside this trigger I configure the "set_avatar", "se= t_text", "set_btn_link", etc, is that right?

On Tue Nov 18 2014 at 9:37:21 PM Chris Angelico <rosuav@gmail.com>= ; wrote:
On Wed, Nov 19, 2014 at 5:15 AM,= Juan Christian
<juan0chri= stian@gmail.com> wrote:
>
> Thanks, it's working. What would be a "professional" app= roach if I want to
> constantly call a URL to get it's content and access this data wit= hin the
> GUI?
>

"Constantly" doesn't make much sense when you're talking = about network
operations. There are two basic approaches: either you re-fetch
periodically and update the GUI (in which case you have to decide how
frequently), or you re-fetch on some trigger (when it's changed, or
when the user's about to need it, or something). Either way, you have to balance network traffic versus promptness of update, and it's
nearly impossible to pick perfectly. But if you don't mind it being a little clunky, you should be able to pick something fairly simple and
deploy it, and then maybe refine it a bit afterward.

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list<= /a>
--001a113aac4e1eb6d805083c52a9--