[IPython-dev] Flask app running interactively on IPython

Rahul K P 36rahu at gmail.com
Tue Jun 23 02:59:41 EDT 2015


I will describe with examples.

TkinterCode.py
~~~~~~~~~
from Tkinter import *

root = Tk()
w = Label(root, text="Hello, world!")
w.pack()

try:
    print '__IPYTHON__ = ',  __IPYTHON__
except:
    root.mainloop()

Run this code on IPython prompt. Like  run TkinterCode.py. After running we
will get the command prompt.

FLaskCode.py
~~~~~~~~~~~
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello World!'

if __name__ == '__main__':
    app.run()

Run this code on IPython promt. Like run FlaskCode.py .After running we
didn't get the command prompt. Is there any option to get the command
prompt while running ?



>>


On Mon, Jun 22, 2015 at 11:06 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> I assume you mean event loop integration. That's generally only done for
> GUI event loops, but there's no reason in principle you couldn't integrate
> with a web app event loop.
>
> See the docs here for more info:
> http://ipython.org/ipython-doc/3/config/eventloops.html
>
> (I love having docs for stuff like this - it saves so much explanation
> when someone asks about it)
>
> Thomas
>
> On 22 June 2015 at 04:58, Matthias Bussonnier <
> bussonniermatthias at gmail.com> wrote:
>
>> Hi Rahul,
>>
>> > On Jun 22, 2015, at 09:27, Rahul K P <36rahu at gmail.com> wrote:
>> >
>> > Hi all,
>> >       Right now am working in image processing in Python. The interface
>> has been build on TKinter at that time we can work the software
>> interactively. The software run using the command run -i program.py. Right
>> now we changed into flask interface and the IPython interactive coding not
>> working here. We didn't get the command line while running. Anyone please
>> help to solve this.
>>
>> We will need a bit more information or code example of what you are doing
>> to be able to help.
>> It would be nice to also understand what you are trying to achieve.
>>
>> Thanks,
>> --
>> Matthias
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150623/0e47107d/attachment.html>


More information about the IPython-dev mailing list