i have this necessity and i would like to know if it's possible to acomplish: I want to put part from my python code inside a WebServer. And, only after a authentication process, the user who is executing my script, will be able to read a file that is in my WebServer and use that content to execute it as part of script. Is there any function in Python that can read a text from file as a variable and execute that code as if it was written inside the script?
Your approach must be a quite bad practice. But you can do for example: exec 'print 1 + 2'
Execute a code read from file