[Flask] Flask vor webbased GUI (2)

Corey Boyle coreybrett at gmail.com
Sun Apr 10 08:39:40 EDT 2016


On Apr 10, 2016 8:00 AM, <nik.gen at gmx.de> wrote:
>
> Ok, thanks.
> Seems like Flask is the right way to go.
>
>
> >I suggest you work through Michael Grinberg's Flask book which will get
you going on the Flask/UI part.
> Michael Grinberg has a very good tutorial as well, i will work through
that.
>
> q1)
> So, for exchanging data between the server and the client without having
to reload the webpage all the time, i use ajax/jquery?
> Right?

Yes

>
> q2)
> >However, you have to figure out a way to make them interact properly
> Ok, so flask has to run either in a thread (e.g. QThread) or in a
separate application, right?
> If it runs in a separate application, what would be a good way of
connecting the two apps?
> Sockets?
>

Maybe have the web app run in an entirely separate process and use a flat
config file to link the two together? Each app watching for changes to the
file. YAML purhaps. Just an idea, not my area of expertise.

> q3) I am using the following method to run my main python application.
Can i not call/run flask within that, without a thread?
>>
>> def main():
>>     app = QCoreApplication(sys.argv)
>>     timerT = QTimer()
>>     timerT.start(2000)
>>     timerT.timeout.connect(oPIV.myTimeTask)
>>     return app.exec_()
>>
>> if __name__ == '__main__':
>>     main()
>
>
> Thanks for your comments,
> Nik
>
>
>
>
>
> Am 09.04.2016 um 07:22 schrieb Chukwudi Nwachukwu:
>>
>> @Nikolau,
>> I've done something with PySide and Flask and ran it on Rocket Web
server to make it fast. One thing I sure know is that Python threads and Qt
do not work together, I stand to be corrected on this though.
>>
>> You would have to make sure that the Qt application would be the one to
spin the thread that would run the server that would power Flask. If you
ask me, Flask is capable of doing all you want and much more. However, you
have to figure out a way to make them interact properly.
>>
>>
>>
>> iChux™
>> http://bit.ly/iscrape
>> Behind every no entry sign, there is a door.
>>
>> On 8 April 2016 at 17:00, <flask-request at python.org> wrote:
>>>
>>> Send Flask mailing list submissions to
>>>         flask at python.org
>>>
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>         https://mail.python.org/mailman/listinfo/flask
>>> or, via email, send a message with subject or body 'help' to
>>>         flask-request at python.org
>>>
>>> You can reach the person managing the list at
>>>         flask-owner at python.org
>>>
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of Flask digest..."
>>>
>>> Today's Topics:
>>>
>>>    1. Flask vor webbased GUI (2) (Nikolaus Neusser)
>>>    2. Re: Flask vor webbased GUI (2) (Corey Boyle)
>>>
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Nikolaus Neusser <nik.gen at gmx.de>
>>> To: flask at python.org
>>> Cc:
>>> Date: Fri, 8 Apr 2016 16:28:28 +0200
>>> Subject: [Flask] Flask vor webbased GUI (2)
>>> Hi everyone,
>>>
>>> Sorry, last time i sent the eMail using another (not registered) eMail
adress.
>>>
>>> i hope this ist the right place to ask my question, if not please let
me know.
>>>
>>> I am wondering if flask is the right web framework to use for my
private project.
>>>
>>> I am running a python program (app) on my raspberry pi in my local home
network.
>>> I would like to add a webbased GUI, that can control my app.
>>> My python program is based on a QT QTimer object that runs a state
machine every second.
>>> The state machine itself runs lots of other functions.
>>>
>>> - the gui content would be (mainly) static html and css using text,
checkboxes, buttons and a listview
>>> - data has to be sent from the gui to my app, i.e. text, current state
of checkboxes and buttons
>>> - data has to be sent from the app to the gui, i.e. text, required
state of checkboxes, data for listview
>>> - sent and received data should directly interact with the state
machine.
>>>
>>> Do you think that can be realized using flask?
>>>
>>> Thanks a lot for your answers.
>>>
>>> Nik
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Corey Boyle <coreybrett at gmail.com>
>>> To: Nikolaus Neusser <nik.gen at gmx.de>
>>> Cc: flask at python.org
>>> Date: Fri, 8 Apr 2016 10:39:20 -0400
>>> Subject: Re: [Flask] Flask vor webbased GUI (2)
>>> Sounds very doable.
>>>
>>> I suggest you work through Michael Grinberg's Flask book which will
>>> get you going on the Flask/UI part.
>>>
>>> On Fri, Apr 8, 2016 at 10:28 AM, Nikolaus Neusser <nik.gen at gmx.de>
wrote:
>>> > Hi everyone,
>>> >
>>> > Sorry, last time i sent the eMail using another (not registered) eMail
>>> > adress.
>>> >
>>> > i hope this ist the right place to ask my question, if not please let
me
>>> > know.
>>> >
>>> > I am wondering if flask is the right web framework to use for my
private
>>> > project.
>>> >
>>> > I am running a python program (app) on my raspberry pi in my local
home
>>> > network.
>>> > I would like to add a webbased GUI, that can control my app.
>>> > My python program is based on a QT QTimer object that runs a state
machine
>>> > every second.
>>> > The state machine itself runs lots of other functions.
>>> >
>>> > - the gui content would be (mainly) static html and css using text,
>>> > checkboxes, buttons and a listview
>>> > - data has to be sent from the gui to my app, i.e. text, current
state of
>>> > checkboxes and buttons
>>> > - data has to be sent from the app to the gui, i.e. text, required
state of
>>> > checkboxes, data for listview
>>> > - sent and received data should directly interact with the state
machine.
>>> >
>>> > Do you think that can be realized using flask?
>>> >
>>> > Thanks a lot for your answers.
>>> >
>>> > Nik
>>> >
>>> > _______________________________________________
>>> > Flask mailing list
>>> > Flask at python.org
>>> > https://mail.python.org/mailman/listinfo/flask
>>> >
>>>
>>>
>>> _______________________________________________
>>> Flask mailing list
>>> Flask at python.org
>>> https://mail.python.org/mailman/listinfo/flask
>>>
>>
>>
>>
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
>
>
>
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160410/570a4708/attachment-0001.html>


More information about the Flask mailing list