blob: e9c8c7897f85d4685b68caf285de1f26e1220c05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env python
import sys
is_py2 = (sys.version_info[0] == 2)
is_py3 = (sys.version_info[0] == 3)
if is_py2:
str = unicode
input = raw_input
def bytes(b, enc="ascii"):
return str(b)
elif is_py3:
str = str
bytes = bytes
input = input
try:
import urllib.request as urllib
except ImportError:
import urllib2 as urllib
try:
from urllib.parse import urlparse, parse_qs
except ImportError:
from urlparse import urlparse, parse_qs
|