Commit f4d2d0d6 authored by Nikhil Chakka's avatar Nikhil Chakka 💬
Browse files

Update home.html, files

<!DOCTYPE html>
<html lang="en">
container{position:relative;width:10%;max-width:960px;margin:0 auto;padding:0 20px;box-sizing:border-box}
h3 {text-align: center;}
#myDIV {
color: blue;
border: 3px solid currentcolor;
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
.button2 {background-color: #008CBA;}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
.alert {
background: green;
padding: 1rem;
border-radius: 5px;
color: white;
margin: 1rem;
<meta charset="UTF-8">
<title>First Flask App</title>
<script src=""></script>
function myFunction() {
var text1= $('#text1').val();
var text2= $('#text2').val();
var text3= $('#text3').val();
var text4= $('#text4').val();
var text5= $('#text5').val();
var text6= $('#text6').val();
url: "/join",
type: "POST",
data: {text1:text1,
}).done(function(response) {
var html= "<br><br><br><p> <b> RESULT : <b><p>";
response =response.result;
html +="<br>";
<body style="background-color:LightGray;">
<div id="#myDIV" class="container">
Age<input type="text" id="text1" name="t1" class="u-full-width" placeholder="age"><br><br>
Sex<input type="text" id="text2" class="u-full-width" name="t2" placeholder="sex"><br><br>
Chespain<input type="text" id="text3" class="u-full-width" name="t3" placeholder="chestpain"><br><br>
Trestbps<input type="text" id="text4" class="u-full-width" name="t4" placeholder="trestbps"><br><br>
Chol<input type="text" id="text5" class="u-full-width" name="t5" placeholder="chol"><br><br>
fbs<input type="text" id="text6" class="u-full-width" name="t6" placeholder="fbs"><br><br>
<button id="clicked" class="button button2" onclick="myFunction()">Submit</button>
<div class="alert">
{{ bill }}
<div class="show-data" >
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
import warnings
dataset = pd.read_csv("heart.csv")
y = dataset["sex"]
from sklearn.model_selection import train_test_split
predictors = dataset.drop("target",axis=1)
target = dataset["target"]
X_train,X_test,Y_train,Y_test = train_test_split(predictors,target,test_size=0.20,random_state=0)
from sklearn.linear_model import LogisticRegression
lr = LogisticRegression(),Y_train)
from flask import Flask, request, render_template,jsonify
app = Flask(__name__)
def do_something(text1,text2,a,b,c,d):
text1 = text1.upper()
text2 = text2.upper()
combine = int(text1) +int(text2)+int(a)+int(b)+int(c)+int(d)
return combine
def home():
return render_template('home.html')
@app.route('/join', methods=['GET','POST'])
def my_form_post():
text1 = request.form['text1']
word = request.args.get('text1')
text2 = request.form['text2']
text3 = request.form['text3']
text4 = request.form['text4']
text5 = request.form['text5']
text6 = request.form['text6']
combine = do_something(text1,text2,text3,text4,text5,text6)
result = {
"output": combine
#result = {str(key): value for key, value in result.items()}
return jsonify(result=result)
if __name__ == '__main__':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment