Download app.py from pakdeveloper/Space_for_a_try_or_practice: direct link, hf CLI and curl.
- Browser
- Download file 3.94 kB
-
https://huggingface.co/spaces/pakdeveloper/Space_for_a_try_or_practice/resolve/main/app.py
- Command line
-
hf download hf://spaces/pakdeveloper/Space_for_a_try_or_practice/app.py
-
curl -L -o app.py https://huggingface.co/spaces/pakdeveloper/Space_for_a_try_or_practice/resolve/main/app.py
3.94 kB
| import gradio as gr | |
| # Define the HTML content | |
| html_content = """ | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Forms in HTML</title> | |
| </head> | |
| <body> | |
| <header> | |
| <div> | |
| <h1><u><i>Travel the World</u></i></h1> | |
| </div> | |
| <span> | |
| <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=" | |
| width="200" height="170" alt="Image"> | |
| </span> | |
| </header> | |
| <main> | |
| <section> | |
| <form action="/about.html"> | |
| <hr> | |
| <div> | |
| <h2>Select your favourite country</h2> | |
| <big><span> | |
| <input type="radio" name="contry" id="200"> | |
| <label for="200">Dubai</label> | |
| <input type="radio" name="contry" id="220"> | |
| <label for="220">Pakistan</label><br> | |
| <input type="radio" name="contry" id="240"> | |
| <label for="240">India</label> | |
| <input type="radio" name="contry" id="260"> | |
| <label for="260">Netherland</label> | |
| </span></big> | |
| </div> | |
| <hr> | |
| <div> | |
| <h2>Choose your travel class</h2> | |
| <span> | |
| <select name="selection" id="selectionid"> | |
| <option value="flight">Select a class</option> | |
| <option value="flight">First Class</option> | |
| <option value="flight">Business Class</option> | |
| <option value="flight">Economy Class</option> | |
| </select> | |
| </span> | |
| </div><br> | |
| <hr> | |
| <!-- fill the form --> | |
| <div> | |
| <h2>Please fill the Form</h2> | |
| <!-- <b><span>Name</span></b> | |
| <input type="text" placeholder="Enter your name"><br> | |
| <b><span>CNIC</span></b> | |
| <input type="text" placeholder="Enter your ID number"><br> | |
| <b><span>Contact</span></b> | |
| <input type="text" placeholder="Enter your phone no."><br> | |
| <b><span>Address</span></b> | |
| <input type="text" placeholder="Enter your address"><br> --> | |
| <!-- <div> --> | |
| <table> | |
| <tr> | |
| <th>Name</th> | |
| <td><input type="text" placeholder="Enter your name"></td> | |
| </tr> | |
| <tr> | |
| <th>CNIC</th> | |
| <td><input type="text" placeholder="Enter your ID number"></td> | |
| </tr> | |
| <tr> | |
| <th>Contact</th> | |
| <td><input type="text" placeholder="Enter your phone number"></td> | |
| </tr> | |
| <tr> | |
| <th>Address</th> | |
| <td><input type="text" placeholder="Enter your address"></td> | |
| </tr> | |
| </table> | |
| <br><span> | |
| <td><input type="button" value="Submit"></td> | |
| </span> | |
| </div> | |
| </form> | |
| </section> | |
| </main> | |
| <footer> | |
| <br> | |
| <hr><br> | |
| </footer> | |
| </body> | |
| </html> | |
| """ | |
| # Define the Gradio interface | |
| def display_html(): | |
| return html_content | |
| # Create the Gradio interface | |
| with gr.Blocks() as demo: | |
| gr.HTML(html_content) | |
| # Launch the Gradio app | |
| demo.launch() |