python脚本中的awk命令
2021-03-02 01:28
标签:error: contain name container point bsp pytho format tps see https://www.cnpython.com/qa/221588 key point: solution: 通过用{}包围来转义{} python脚本中的awk命令 标签:error: contain name container point bsp pytho format tps 原文地址:https://www.cnblogs.com/LeoGIS/p/14421194.htmlrun(‘docker ps -a | grep {} | awk "{print $1}"‘.format(container_name))
KeyError: ‘print $1‘
so it should be:run(‘docker ps -a | grep {} | awk "{{print $1}}"‘.format(container_name))