本文整理匯總了Python中winerror.ERROR_RESOURCE_DATA_NOT_FOUND屬性的典型用法代碼示例。如果您正苦於以下問題:Python winerror.ERROR_RESOURCE_DATA_NOT_FOUND屬性的具體用法?Python winerror.ERROR_RESOURCE_DATA_NOT_FOUND怎麽用?Python winerror.ERROR_RESOURCE_DATA_NOT_FOUND使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類winerror
的用法示例。
在下文中一共展示了winerror.ERROR_RESOURCE_DATA_NOT_FOUND屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: extract_manifest
# 需要導入模塊: import winerror [as 別名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 別名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(handle, RT_MANIFEST, resource_name)
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例2: extract_manifest
# 需要導入模塊: import winerror [as 別名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 別名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(
handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore')
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例3: extract_manifest
# 需要導入模塊: import winerror [as 別名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 別名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(handle, RT_MANIFEST, resource_name)
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise
示例4: extract_manifest
# 需要導入模塊: import winerror [as 別名]
# 或者: from winerror import ERROR_RESOURCE_DATA_NOT_FOUND [as 別名]
def extract_manifest(path, resource_name):
"""Reads manifest from |path| and returns it as a string.
Returns None is there is no such manifest."""
with LoadLibrary(path) as handle:
try:
return win32api.LoadResource(
handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore')
except pywintypes.error as error:
if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND:
return None
else:
raise