简体   繁体   English

Python:NameError:未定义全局名称“nt”

[英]Python: NameError: global name 'nt' is not defined

Guys i'm facing the error on my python code, i've trying many things and the error persist, how to solve?伙计们,我的 python 代码遇到错误,我尝试了很多事情,但错误仍然存在,如何解决?

The code was running many months in... and suddently stopped代码运行了好几个月......突然停止了

The message error is...消息错误是...

global name 'nt' is not defined: NameError Traceback (most recent call last): File "/var/task/lambda_function.py", line 35, in lambda_handler nt("Lambda Function Name: " + context.function_name) NameError: global name 'nt' is not defined全局名称“nt”未定义:NameError Traceback(最近一次调用最后一次):文件“/var/task/lambda_function.py”,第 35 行,在 lambda_handler nt("Lambda Function Name:" + context.function_name) NameError:未定义全局名称“nt”

# Clients
sns_client = boto3.client('sns')
s3_client = boto3.client('s3')
athena_client = boto3.client('athena')

def lambda_handler(event, context):

    nt("Lambda Function Name : " + context.function_name)
    bucket = event['Records'][0]['s3']['bucket']['name']

... ...

It does not know the function nt.它不知道 function nt。 Maybe nt is a typo for print?也许 nt 是打印的错字? Like print("Lambda Function Name: " + context.function_name)像 print("Lambda Function 名称:" + context.function_name)

its not nt its print它不是它的印刷品

print("Lambda Function Name : " + context.function_name)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM