Python 3.6: How to expand f-string literals read from a file vs inline statement

Ned Batchelder ned at nedbatchelder.com
Fri Mar 23 13:07:04 EDT 2018


On 3/23/18 12:39 PM, Malcolm Greene wrote:
>> Perhaps it doesn't need to be said, but just to be sure: don't use eval  if you don't trust the people writing the configuration file. They can do nearly unlimited damage to your environment.  They are writing code that you are running.
> Of course! Script and config file are running in a private subnet and both are maintained by a single developer.

Then why make your life difficult?  Put the "configuration" in a .py file.

--Ned.



More information about the Python-list mailing list