Created
July 24, 2017 03:32
-
-
Save riverfor/dae8b85b8a657d93c5086ea207c80eb3 to your computer and use it in GitHub Desktop.
easter-egg.py for qpython ios
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Author: Rriver | |
# Can you send the easter egg's result to us ? : ) | |
import urllib,re,random | |
qw = 'http://www.qpython.org/' | |
html = urllib.urlopen(qw).read() | |
reg = r'src="(.*?\.jpg)' | |
imgre = re.compile(reg) | |
imglist = re.findall(imgre,html) | |
pics = [] | |
for imgurl in imglist: | |
pics.append("%s%s" % (qw,imgurl)) | |
print '<img src="%s" />' % random.choice(pics) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment