- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
for x in data:
id = int(x['id'])
if id >= 1:
idx = '00000'
if id >= 10:
idx = '0000'
if id >= 100:
idx = '000'
if id >= 1000:
idx = '00'
if id >= 10000:
idx = '0'
if id >= 100000:
idx = ''
path = urlparse(x['url']).path
ext = os.path.splitext(path)[1]
filename = idx + str(id) + '.' + ext
Vindicar 13.01.2016 19:18 # 0
WGH 13.01.2016 21:28 # +3
bormand 13.01.2016 21:30 # +1
gost 15.01.2016 13:15 # +1
>Для олдфагов.
Черт, я олдфаг.