-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pavel intalov #25
Open
jskonst
wants to merge
13
commits into
ISUCT:Pavel_Intalov
Choose a base branch
from
PavelSlaanesh:Pavel_Intalov
base: Pavel_Intalov
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Pavel intalov #25
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5f14e00
Работа
PavelSlaanesh f381c78
записал зачот
PavelSlaanesh 9a8a9bc
laba
PavelSlaanesh 94f4605
о прекрасный суп наварили
PavelSlaanesh e55f8d6
Омниссия спаси мой код
PavelSlaanesh f3cae10
попытки в картинку
PavelSlaanesh c681d0c
картинка получа
PavelSlaanesh d287661
фон цвет
PavelSlaanesh 0b3bb64
Бикини ботм + калькулятор
PavelSlaanesh 0c2ad10
калькулятор калт
PavelSlaanesh 72a6d6d
Калькулятор с фоном
PavelSlaanesh 1838c44
Киски
PavelSlaanesh 19f55fe
Котики конец
PavelSlaanesh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from unicodedata import name | ||
from flask import Flask, render_template | ||
from datetime import datetime | ||
|
||
from flask import request | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route("/") | ||
def index(): | ||
now = datetime.now() | ||
user = {'username': 'Павлик'} | ||
if now.hour > 5 and now.hour < 12: | ||
time_of_day = "morning" | ||
elif now.hour >= 12 and now.hour < 17: | ||
time_of_day = "day" | ||
elif now.hour >= 17 and now.hour < 23: | ||
time_of_day = "evening" | ||
items = ["один", "два", "три", "четыре", "пять"] | ||
|
||
return render_template('index.html', title='home', user=user, time_of_day=time_of_day, items=items, ) | ||
|
||
@app.route("/simple") | ||
def simple(): | ||
a = request.args.get("a", default=5,type=float) | ||
b = request.args.get("b", default=10) | ||
return f"<h1>{a}+{b}={a+b}</h1>" | ||
|
||
@app.route("/Hello") | ||
def hello_world(): | ||
now = datetime.now() | ||
return f"<p>О ПРЕКРАСНЫЙ СУП НАВАРИЛИ! {now}</p>" | ||
|
||
@app.route("/styled") | ||
def hello_styles(): | ||
now = datetime.now() | ||
return f""" | ||
<h1>Заголовушка</h1> | ||
<p>О ПРЕКРАСНЫЙ СУП НАВАРИЛИ!</p> | ||
<p>Времы судного дня {now}</p> | ||
""" | ||
|
||
@app.route('/calc', methods=['GET', 'POST']) | ||
def calc(): | ||
a = request.form.get("a",default=0,type=float) | ||
b = request.form.get("b",default=0,type=float) | ||
return render_template("calc.html", a=a, b=b, result=a+b) | ||
|
||
import cat | ||
|
||
cats = { | ||
"vasya": cat.Cat("vasya", 3), | ||
"barsik": cat.Cat("barsik", 3), | ||
"murzik": cat.Cat("murzik", 3), | ||
} | ||
|
||
@app.route('/cats') | ||
def list_cats(): | ||
return render_template("cats.html", cats = cats) | ||
|
||
@app.route("/cats/<name>") | ||
def show_cat(name): | ||
cat = cats[name] | ||
return render_template("cat.html", cat = cat) | ||
|
||
@app.route("/cats/new", methods=["GET", "POST"]) | ||
def create_cat(): | ||
name = request.form.get("name",default="untitled") | ||
age = request.form.get("age",default=0,type=float) | ||
|
||
new_cat = cat.Cat(name, age) | ||
|
||
cats[new_cat.name] = new_cat | ||
|
||
return render_template("new_cat.html") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Cat: | ||
def __init__(self, name, age, img=""): | ||
self.name = name | ||
self.age = age | ||
self.img = img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import math | ||
from re import X | ||
from tkinter import Y | ||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. вот эти 2 импорта не нужны |
||
def calc(x: float) float: | ||
return (math.asin(x)*4+math.acos(x)*6)*1/7 | ||
def task_a(xn,xkm,dx): | ||
x=xn | ||
y=[] | ||
while x <=xk: | ||
y_tmp=calc(x) | ||
y.append(y_tmp) | ||
x += dx | ||
return (y) | ||
def task_b(x): | ||
y=[] | ||
for item in x: | ||
y.append(calc(item)) | ||
if __name__ = "__main__": | ||
y= task_a(0.22,0.92,0.14) | ||
print (y) | ||
y=task_b([0.1,0.35,0.4,0.55,0.6]) | ||
print (X) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html> | ||
<head> | ||
<title>Cat</title> | ||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous"> | ||
</head> | ||
<body> | ||
{% block main %}{% endblock %} | ||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<html> | ||
<head> | ||
<title>Calculator</title> | ||
</head> | ||
<body style="background-image:url(static/fon.jpg)"> | ||
<h1>Calculator</h1> | ||
<form action="" method="POST"> | ||
<input type="number" value="{{a}}" name="a"/> | ||
+ | ||
<input type="number" value="{{b}}" name="b"/> | ||
<button type="submit">Calc</button> | ||
</form> | ||
<p>Result = {{result}}</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% extends "base_cat.html" %} | ||
{% block main %} | ||
<h1>{{cat.name}}:</h1> | ||
<ul> | ||
<li> | ||
Возраст: {{ cat.age }} | ||
</li> | ||
{% if cat.img %} | ||
<li> | ||
<img src="{{cat.img}}"/> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% extends "base_cat.html" %} | ||
{% block main %} | ||
<h1>Киски:</h1> | ||
<ul> | ||
{% for key, cat in cats.items() %} | ||
<li> | ||
<a href="{{'cats/%s' % cat.name}}"> {{ cat.name }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<a href="cats/new" class="btn btn-primary" role="button">Добавить</a> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Отче наш, иже еси в моем PC. Да святится имя и расширение Твое. Да придет прерывание Твое и да будет воля твоя. BASIC наш насущный дай нам; И прости нам дизассемблеры и антивирусы наши, как Копиpайты прощаем мы. И не введи нас в Exception Error, но избавь нас от зависания, ибо Твое есть адpессное пространство, порты и регистры. | ||
<html> | ||
<head> | ||
<title>{{ title }} - Microblog</title> | ||
</head> | ||
<body style="background-image:url(static/fon.jpg)"> | ||
{% if time_of_day == "morning" %} | ||
<h1>Да будет с тобой святой машинный код 1, {{ user.username }}!</h1> | ||
<img src="static/xxx.jpg" alt="икона" width="100" height="80" /> | ||
{% elif time_of_day == "day" %} | ||
<h1>Да будет с тобой святой машинный код 2, {{ user.username }}!</h1> | ||
<p><img src="static/ххх.jpg" alt="икона" width="100" height="80"></p> | ||
{% elif time_of_day == "evening" %} | ||
<h1>Да будет с тобой святой машинный код 3, {{ user.username }}!</h1> | ||
{% else %} | ||
<h1>Да будет с тобой святой машинный код 4, {{ user.username }}!</h1> | ||
{% endif %} | ||
<ul> | ||
{% for element in items %} | ||
<li>{{element}}</li> | ||
{% endfor %} | ||
</ul> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не забывайцте добавлять расширение файла - .py