Skip to content

Instantly share code, notes, and snippets.

Arti3DPlayer / Дневник Еврея
Last active July 6, 2017 17:03
Дневник Еврея
sum_ = sum(result.values())
for i in result:
result[i] = int((kwargs[i] * 100 / sum_).quantize(Decimal('.0000'), rounding=ROUND_UP))
except InvalidOperation:
result[i] = 0
total_percents = sum(result.values())
# -*- coding: utf-8 -*-
import random
import vk_api
import soundcloud
import urllib
import urllib2
import time
import hashlib
import json
# -*- coding: utf-8 -*-
import json
from django.utils import timezone
from django.shortcuts import redirect, get_object_or_404, render_to_response, \
from django.core.urlresolvers import reverse, reverse_lazy
from django.db import IntegrityError
from django.http import Http404, HttpResponse, HttpResponseRedirect