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