I trust you. I had to be careful with my response because I know there
are a couple of people here looking for posts they can take out of
context, post on reddit, as say "see! Massimo suggests using exec of
user input."

Massimo

On Sep 21, 8:39 am, "Jason (spot) Brower" <[email protected]> wrote:
> Yeah, I just figured that out and have come to tell it now. :D
> Yeah, I have my reasons and it won't be used in production.
> BR,
> Jason Brower
>
> On Tue, Sep 21, 2010 at 3:38 PM, mdipierro <[email protected]> wrote:
> > disclamer: there security issues in exec-ing user's code but I assume
> > you have good reasons for it. ;-)
>
> > instead of exec(code) do exec(code.replace('\r\n','\n').strip()+'\n')
>
> > On Sep 21, 5:31 am, "Jason (spot) Brower" <[email protected]> wrote:
> >> I have a text area that I can grab the python code from.
> >> When I try to run the code how ever, I get the following error:
> >> "SyntaxError: unexpected EOF while parsing"
> >> This error only happens if I put a return in the text area.  Otherwise
> >> it will run a single line just fine.  I want to have multiline inputs
> >> and have it execute that.  Is there something I am missing here?  Many
> >> examples use triple quoted mutli line values so I figured this would
> >> be the same thing, I guess I was wrong. :/
> >> Best Regards,
> >> Jason
>
>

Reply via email to