<style>blockquote {padding-left: 1ex; margin: 0px 0px 0px 0.8ex; border-left: #cccccc 1px solid;} p {margin: 0px;padding: 0px;} </style>
<p>Hi,</p>
<p>This is not possible in my case since I do need to have access to application context for example the SQLAlchemy class instance. Otherwise I would need to create an external script accessing the same database but I would still miss the runtime info from flask application. The best option from my end would be to inject code into running flask app instance and execute it from there. Since I've never done it before I'm looking for any tips or maybe somebody did it already and is willing to 
share expirence. </p>
<p> </p>
<p>So to make long story short: user passes through form string that is python code, the code gets executed within flask app. Ideally I would like to add this functionality as seperate flask blueprint but I don't think that has any direct impact on highlevel implementation.</p>
<p> </p>
<p>BR</p>
<p>Alex </p>
<p> </p>
<blockquote>
<p dir="ltr">Why not use a form to collect the code, then pipe it into a Python process using the <a href="https://docs.python.org/2/library/subprocess.html#module-subprocess">subprocess</a> module. You may have to store the code in a temp file, not sure.</p>
<p dir="ltr">What are your end goals?</p>
<div class="gmail_extra">
<div class="gmail_quote"> </div>
</div>
</blockquote><br />