Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,49 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
st.title("Hello, Streamlit!")
|
| 4 |
-
st.write("This is a simple Streamlit app.")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
|
| 4 |
+
html_code = '''
|
| 5 |
+
<!DOCTYPE html>
|
| 6 |
+
<html lang="en">
|
| 7 |
+
<head>
|
| 8 |
+
<meta charset="UTF-8">
|
| 9 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 10 |
+
<title>Complex Calculator</title>
|
| 11 |
+
<style>
|
| 12 |
+
/* CSS code from style.css */
|
| 13 |
+
</style>
|
| 14 |
+
</head>
|
| 15 |
+
<body>
|
| 16 |
+
<div class="calculator">
|
| 17 |
+
<div class="display" id="display">0</div>
|
| 18 |
+
<div class="buttons">
|
| 19 |
+
<button class="btn" onclick="clearDisplay()">C</button>
|
| 20 |
+
<button class="btn" onclick="deleteLast()">DEL</button>
|
| 21 |
+
<button class="btn" onclick="appendOperator('%')">%</button>
|
| 22 |
+
<button class="btn operator" onclick="appendOperator('/')">/</button>
|
| 23 |
+
<button class="btn" onclick="appendNumber('7')">7</button>
|
| 24 |
+
<button class="btn" onclick="appendNumber('8')">8</button>
|
| 25 |
+
<button class="btn" onclick="appendNumber('9')">9</button>
|
| 26 |
+
<button class="btn operator" onclick="appendOperator('*')">*</button>
|
| 27 |
+
<button class="btn" onclick="appendNumber('4')">4</button>
|
| 28 |
+
<button class="btn" onclick="appendNumber('5')">5</button>
|
| 29 |
+
<button class="btn" onclick="appendNumber('6')">6</button>
|
| 30 |
+
<button class="btn operator" onclick="appendOperator('-')">-</button>
|
| 31 |
+
<button class="btn" onclick="appendNumber('1')">1</button>
|
| 32 |
+
<button class="btn" onclick="appendNumber('2')">2</button>
|
| 33 |
+
<button class="btn" onclick="appendNumber('3')">3</button>
|
| 34 |
+
<button class="btn operator" onclick="appendOperator('+')">+</button>
|
| 35 |
+
<button class="btn zero" onclick="appendNumber('0')">0</button>
|
| 36 |
+
<button class="btn" onclick="appendNumber('.')">.</button>
|
| 37 |
+
<button class="btn equals" onclick="calculateResult()">=</button>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
<script>
|
| 41 |
+
/* JavaScript code from script.js */
|
| 42 |
+
</script>
|
| 43 |
+
</body>
|
| 44 |
+
</html>
|
| 45 |
+
'''
|
| 46 |
+
|
| 47 |
+
components.html(html_code, height=600)
|
| 48 |
+
|
| 49 |
|
|
|
|
|
|