本文整理汇总了Python中authentication.Authentication.access方法的典型用法代码示例。如果您正苦于以下问题:Python Authentication.access方法的具体用法?Python Authentication.access怎么用?Python Authentication.access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类authentication.Authentication
的用法示例。
在下文中一共展示了Authentication.access方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Authentication
# 需要导入模块: from authentication import Authentication [as 别名]
# 或者: from authentication.Authentication import access [as 别名]
__author__ = 'bijan'
from PIL import Image
from io import BytesIO
from authentication import Authentication
import os
GFX_URL = 'http://www.pythonchallenge.com/pc/return/evil2.gfx'
auth = Authentication(GFX_URL, 'huge', 'file')
gfx_read = auth.access()
if not os.path.exists('/12solution'):
os.makedirs('12solution')
for i in range(5):
image = gfx_read[i::5]
image_object = Image.open(BytesIO(image))
with open("12solution/%d.%s" % (i, image_object.format.lower()), "wb") as imagefile:
imagefile.write(image)
示例2: Authentication
# 需要导入模块: from authentication import Authentication [as 别名]
# 或者: from authentication.Authentication import access [as 别名]
__author__ = "bijan"
from PIL import Image
from io import BytesIO
from authentication import Authentication
IMAGE_URL = "http://www.pythonchallenge.com/pc/return/cave.jpg"
auth = Authentication(IMAGE_URL)
image = BytesIO(auth.access())
image = Image.open(image)
pix = image.load()
new_image = Image.new(image.mode, image.size)
[new_image.putpixel([i, j], pix[i, j]) for j in range(0, image.size[1], 2) for i in range(0, image.size[0], 2)]
new_image.show()