[Flask] Interchange data with main python application

Anthony Ford ford.anthonyj at gmail.com
Fri May 20 11:30:43 EDT 2016


My suggestion is to avoid running either within the other. If possible, try
running each standalone. For inter process communication, try using socket
communication, either with straight sockets or via something like zeromq or
similar.

--Ford
On May 20, 2016 10:12 AM, "Nikolaus Neusser" <nik.gen at gmx.de> wrote:

> Hi everyone,
>
> I'm using flask for the first time and after trying quite a lot, i still
> fail. :-(
> I am wondering what i am doing wrong and if flask is the right way to go
> at all.
>
> My objective:
>    - I have a main python application, which basically is based on a
> PySide (QT4) event loop.
>      This runs a bigger state machine and several other functions.
>    - Now, i want to add a web interface which reads/sets parameters and
> displays a longer list of
>      strings from the main application (variable length) .
>
> Where i am:
>    - The simple flask examples from various tutorials work fine for me.
>    - BUT: I cannot combine my main application with flask, i.e. i don't
> know how to
>      interchange the data between my main application and the flask
> route-functions.
>
> What i tried:
>    - running flask in a thread (QThread). Works fine for a simple example,
> i.e. deliver static html
>      and react on get-request
>    - run flask in main thread. Doesn't work since some of my functions
> rely on the qt event loop
>    - interchanging data between my main application and flask in the
> thread. I tried this using the
>      qt signal/slot mechanism.
>      This doesn't work, because the signals which i have to define in the
> main application are not
>      accessible within the flask route-functions.
>
>
> I really hope you can give me some good advice.
> I can post code snippets if it helps for clarification.
>
> Thanks a lot,
>
> Nik
> _______________________________________________
> 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/20160520/1a55f4f8/attachment-0001.html>


More information about the Flask mailing list