在函数中使用subprocess.check_output()代替subprocess.call()。
解决方法示例:
import subprocess
def lambda_handler(event, context): command = ['ls', '-l'] result = subprocess.check_output(command) print(result.decode())
上一篇:AWSLambda函数中使用Pandas从S3桶读取CSV出现'Expected1fieldsinline5,saw2”错误
下一篇:AWSLambda函数中有没有一种方法可以获得日志流名称?