Update app.py
Browse files
app.py
CHANGED
|
@@ -1,2 +1,110 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
|
| 3 |
+
# Define the HTML content
|
| 4 |
+
html_content = """
|
| 5 |
+
<!DOCTYPE html>
|
| 6 |
+
<html lang="en">
|
| 7 |
+
|
| 8 |
+
<head>
|
| 9 |
+
<meta charset="UTF-8">
|
| 10 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 11 |
+
<title>Forms in HTML</title>
|
| 12 |
+
</head>
|
| 13 |
+
|
| 14 |
+
<body>
|
| 15 |
+
<header>
|
| 16 |
+
<div>
|
| 17 |
+
<h1><u><i>Travel the World</u></i></h1>
|
| 18 |
+
</div>
|
| 19 |
+
<span>
|
| 20 |
+
<img src="https://media.istockphoto.com/id/1314724689/vector/airplane-fly-icon-plane-flying-with-line.jpg?s=612x612&w=0&k=20&c=mYE9Rmp2s6CViWJHaMH_3Ai-doIvRcYNqyzfIDdBAXs="
|
| 21 |
+
width="200" height="170" alt="Image">
|
| 22 |
+
</span>
|
| 23 |
+
</header>
|
| 24 |
+
<main>
|
| 25 |
+
<section>
|
| 26 |
+
<form action="/about.html">
|
| 27 |
+
<hr>
|
| 28 |
+
<div>
|
| 29 |
+
<h2>Select your favourite country</h2>
|
| 30 |
+
<big><span>
|
| 31 |
+
<input type="radio" name="contry" id="200">
|
| 32 |
+
<label for="200">Dubai</label>
|
| 33 |
+
<input type="radio" name="contry" id="220">
|
| 34 |
+
<label for="220">Pakistan</label><br>
|
| 35 |
+
<input type="radio" name="contry" id="240">
|
| 36 |
+
<label for="240">India</label>
|
| 37 |
+
<input type="radio" name="contry" id="260">
|
| 38 |
+
<label for="260">Netherland</label>
|
| 39 |
+
</span></big>
|
| 40 |
+
</div>
|
| 41 |
+
<hr>
|
| 42 |
+
<div>
|
| 43 |
+
<h2>Choose your travel class</h2>
|
| 44 |
+
<span>
|
| 45 |
+
<select name="selection" id="selectionid">
|
| 46 |
+
<option value="flight">Select a class</option>
|
| 47 |
+
<option value="flight">First Class</option>
|
| 48 |
+
<option value="flight">Business Class</option>
|
| 49 |
+
<option value="flight">Economy Class</option>
|
| 50 |
+
</select>
|
| 51 |
+
</span>
|
| 52 |
+
</div><br>
|
| 53 |
+
<hr>
|
| 54 |
+
|
| 55 |
+
<!-- fill the form -->
|
| 56 |
+
<div>
|
| 57 |
+
<h2>Please fill the Form</h2>
|
| 58 |
+
<!-- <b><span>Name</span></b>
|
| 59 |
+
<input type="text" placeholder="Enter your name"><br>
|
| 60 |
+
<b><span>CNIC</span></b>
|
| 61 |
+
<input type="text" placeholder="Enter your ID number"><br>
|
| 62 |
+
<b><span>Contact</span></b>
|
| 63 |
+
<input type="text" placeholder="Enter your phone no."><br>
|
| 64 |
+
<b><span>Address</span></b>
|
| 65 |
+
<input type="text" placeholder="Enter your address"><br> -->
|
| 66 |
+
<!-- <div> -->
|
| 67 |
+
<table>
|
| 68 |
+
<tr>
|
| 69 |
+
<th>Name</th>
|
| 70 |
+
<td><input type="text" placeholder="Enter your name"></td>
|
| 71 |
+
</tr>
|
| 72 |
+
<tr>
|
| 73 |
+
<th>CNIC</th>
|
| 74 |
+
<td><input type="text" placeholder="Enter your ID number"></td>
|
| 75 |
+
</tr>
|
| 76 |
+
<tr>
|
| 77 |
+
<th>Contact</th>
|
| 78 |
+
<td><input type="text" placeholder="Enter your phone number"></td>
|
| 79 |
+
</tr>
|
| 80 |
+
<tr>
|
| 81 |
+
<th>Address</th>
|
| 82 |
+
<td><input type="text" placeholder="Enter your address"></td>
|
| 83 |
+
</tr>
|
| 84 |
+
</table>
|
| 85 |
+
<br><span>
|
| 86 |
+
<td><input type="button" value="Submit"></td>
|
| 87 |
+
</span>
|
| 88 |
+
</div>
|
| 89 |
+
</form>
|
| 90 |
+
</section>
|
| 91 |
+
</main>
|
| 92 |
+
<footer>
|
| 93 |
+
<br>
|
| 94 |
+
<hr><br>
|
| 95 |
+
</footer>
|
| 96 |
+
</body>
|
| 97 |
+
|
| 98 |
+
</html>
|
| 99 |
+
"""
|
| 100 |
+
|
| 101 |
+
# Define the Gradio interface
|
| 102 |
+
def display_html():
|
| 103 |
+
return html_content
|
| 104 |
+
|
| 105 |
+
# Create the Gradio interface
|
| 106 |
+
with gr.Blocks() as demo:
|
| 107 |
+
gr.HTML(html_content)
|
| 108 |
+
|
| 109 |
+
# Launch the Gradio app
|
| 110 |
+
demo.launch()
|