铁蟒:Microsoft.synRexception脚本:'意外标记'=''

2024-06-11 06:10:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个Python script,我正试图使用IronPython从C代码执行,得到以下错误消息:

Microsoft.Scripting.SyntaxErrorException: 'unexpected token '=''

下面是我的Python代码:

import logging
logging.basicConfig(filename='c:\\rahul\\example.log',level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')

BUCKET_NAME='Rahul'
print("Bucket name :-" + BUCKET_NAME)

下面是我的.NET C代码:

^{pr2}$

我从最后一行得到一个错误:

Microsoft.Scripting.SyntaxErrorException: 'unexpected token '=''

有什么帮助吗?在


Tags: 代码nametokenlogbucketlogging错误script