Example #1
0
            counts[0] * r[3][0] + counts[1] * r[4][0] + counts[2] * r[5][0] +
            (q_peak - counts[0]) * r[3][1] +
            (q_semipeak - counts[1]) * r[4][1] +
            (q_night - counts[2]) * r[5][1], 2))
    tar_peak = str(r[3][1])
    tar_semipeak = str(r[4][1])
    tar_night = str(r[5][1])
else:  #если потреблено < соц.нормы
    total = str(
        round(q_peak * r[3][0] + q_semipeak * r[4][0] + q_night * r[5][0], 2))
    tar_peak = str(r[3][0])
    tar_semipeak = str(r[4][0])
    tar_night = str(r[5][0])
    dif = q_peak + q_semipeak + q_night - n

log = ckks.set_cookies()
print("""Content-type: text/html\n
<!DOCTYPE html>
<html lang="ru">
	<head>
		<meta charset="windows-1251">
		<title>Законы и формулы - Электрономия Нижний Новгород</title>
		<link rel="stylesheet" href="../css/main.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
	<script src="js/jquery.easing.min.js"></script>
	<script src="js/cbpFixedScrollLayout.min.js"></script>
	<script type="text/javascript">
	$(function() {{
	$(window).scroll(function() {{
	if($(this).scrollTop() != 0) {{
	$('#toTop').fadeIn();
Example #2
0
import fileinput, sys, cgi, ckks, csv

loginform = cgi.FieldStorage()

log = ckks.set_cookies()
header = """Content-type: text/html\n
<!DOCTYPE html>
<html lang="ru">
	<head>
		<meta charset="windows-1251">
		<title>Законы и формулы - Электрономия Нижний Новгород</title>
		<link rel="stylesheet" href="../css/main.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
	<script src="js/jquery.easing.min.js"></script>
	<script src="js/cbpFixedScrollLayout.min.js"></script>
	<script type="text/javascript">
	$(function() {{
	$(window).scroll(function() {{
	if($(this).scrollTop() != 0) {{
	$('#toTop').fadeIn();
	}} else {{
	$('#toTop').fadeOut();
	}}
	}});
	$('#toTop').click(function() {{
	$('body,html').animate({{scrollTop:0}},800);
	}});
	}});
	</script>
	<script>
		$(function() {{