When i tried this code to download the picture from website and display it on pygame, i got the following error (ImportError: DLL load failed: The specified module could not be found.)
Code: Select all
import pygame
from pygame.locals import *
import requests
from OpenSSL import SSL
pygame.init()
r1 = requests.get("https://cgaxisimages.ams3.digitaloceanspaces.com/home/klient.dhosting.pl/cgaxis/cgaxis.com/public_html/store/wp-content/uploads/2018/02/cgaxis_hdri_skies_01_57-1.jpg", verify=False)
r2 = requests.get("http://www.screenspro.com/thumbs/small4cc492db239c5.jpg")
with open('surface.png', 'wb') as f:
f.write(r1.content)
with open('sea.png', 'wb') as f1:
f1.write(r2.content)
screen = pygame.display.set_mode((600,440))
background_1 = pygame.image.load(f).convert()
background_2 = pygame.image.load(f1).convert()
bg_1 = background_1.get_rect()
bg_2 = background_2.get_rect()
bgrect = bg_1.move(300, 220)
bgrect2 = bg_2.move(300, 220)
while True:
bgrect.blit(bgrect,(10,10))
bgrect2.blit(bgrect, (10,10))
pygame.display.update()Please advise as due to the https:// i need to use SSL