Azure Table 存储 Python SDK,语法无效
Azure Table Storage Python SDK, Invalid syntax
我正在使用 Azure Table 服务和他们的 python SDK,下面给出的是我的代码的一部分,但我相信错误来自 SDK
from azure.storage import TableService, Entity
from datetime import datetime
ac_name = 'my_account_name'
primary_key = 'my_primary_key'
table_name = 'my_table_name'
def get_connection_string_and_create_table():
global table_service
table_service = TableService(account_name = ac_name,account_key=primary_key)
table_service.create_table(table=table_name)
在 Windows 中 运行ning 时代码工作正常,但在 Raspberry 中尝试 运行 时抛出以下错误(运行ning Raspbian OS)
from azure.storage import TableService, Entity
File "/usr/local/lib/python3.2/dist-packages/azure/storage/__init__.py" line 55
self.prefix = u''
SyntaxError: invalid syntax
有人可以帮我解决这个问题吗? :) 我会很高兴的:)
重新引入了字符串文字的 u""
语法 only in Python 3.3, so as you're using Python 3.2 you will get a syntax error。
To ease the transition from Python 2 for Unicode aware Python
applications that make heavy use of Unicode literals, Python 3.3 once
again supports the “u”
prefix for string literals. This prefix has no
semantic significance in Python 3, it is provided solely to reduce the
number of purely mechanical changes in migrating to Python 3, making
it easier for developers to focus on the more significant semantic
changes (such as the stricter default separation of binary and text
data).
因此,要么摆脱 u''
(默认情况下所有字符串在 Python 3 中已经是 unicode 字符串),要么将 Python 3 升级到更新版本以使其成为工作。
我正在使用 Azure Table 服务和他们的 python SDK,下面给出的是我的代码的一部分,但我相信错误来自 SDK
from azure.storage import TableService, Entity
from datetime import datetime
ac_name = 'my_account_name'
primary_key = 'my_primary_key'
table_name = 'my_table_name'
def get_connection_string_and_create_table():
global table_service
table_service = TableService(account_name = ac_name,account_key=primary_key)
table_service.create_table(table=table_name)
在 Windows 中 运行ning 时代码工作正常,但在 Raspberry 中尝试 运行 时抛出以下错误(运行ning Raspbian OS)
from azure.storage import TableService, Entity
File "/usr/local/lib/python3.2/dist-packages/azure/storage/__init__.py" line 55
self.prefix = u''
SyntaxError: invalid syntax
有人可以帮我解决这个问题吗? :) 我会很高兴的:)
重新引入了字符串文字的 u""
语法 only in Python 3.3, so as you're using Python 3.2 you will get a syntax error。
To ease the transition from Python 2 for Unicode aware Python applications that make heavy use of Unicode literals, Python 3.3 once again supports the
“u”
prefix for string literals. This prefix has no semantic significance in Python 3, it is provided solely to reduce the number of purely mechanical changes in migrating to Python 3, making it easier for developers to focus on the more significant semantic changes (such as the stricter default separation of binary and text data).
因此,要么摆脱 u''
(默认情况下所有字符串在 Python 3 中已经是 unicode 字符串),要么将 Python 3 升级到更新版本以使其成为工作。