fork download
  1. from random import *
  2. import urllib.request, re
  3. my_url = input("\ ")
  4. name = "".join(sample([chr(i) for i in range(97, 123)],6))+str(randint(11111,99999))+str(randint(11111,99999))
  5. ext = re.findall(r'.+(\.{1}[a-zA-Z]+)[^\.]*', my_url)[0]
  6. pic = urllib.request.urlopen(my_url).read()
  7. f = open(name+ext, "wb")
  8. f.write(pic)
  9. f.close()
  10. print('OK')
Runtime error #stdin #stdout #stderr 0.23s 15216KB
stdin
Standard input is empty
stdout
\ 
stderr
Traceback (most recent call last):
  File "./prog.py", line 3, in <module>
EOFError: EOF when reading a line