Spaces:
Runtime error
Runtime error
adarsh
commited on
Commit
·
a31a9c7
1
Parent(s):
78c1623
updated count algo
Browse files
app.py
CHANGED
|
@@ -103,12 +103,17 @@ def main():
|
|
| 103 |
st.markdown('<p style="text-align:center;">Made with ❤️ by <a href="https://www.adarshmaurya.onionreads.com">Adarsh Maurya</a></p>', unsafe_allow_html=True)
|
| 104 |
|
| 105 |
# Add page visit count
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
# Display page visit count
|
| 111 |
-
st.markdown(f'<p style="text-align:center;">Page Visits: {
|
| 112 |
|
| 113 |
|
| 114 |
# Run the app
|
|
|
|
| 103 |
st.markdown('<p style="text-align:center;">Made with ❤️ by <a href="https://www.adarshmaurya.onionreads.com">Adarsh Maurya</a></p>', unsafe_allow_html=True)
|
| 104 |
|
| 105 |
# Add page visit count
|
| 106 |
+
with open("assets/counter.txt", "r") as f:
|
| 107 |
+
pVisit = int(f.read())
|
| 108 |
+
|
| 109 |
+
pVisit += 1
|
| 110 |
+
|
| 111 |
+
with open("assets/counter.txt", "w") as f:
|
| 112 |
+
f.write(str(pVisit))
|
| 113 |
+
|
| 114 |
|
| 115 |
# Display page visit count
|
| 116 |
+
st.markdown(f'<p style="text-align:center;">Page Visits: {pVisit}</p>', unsafe_allow_html=True)
|
| 117 |
|
| 118 |
|
| 119 |
# Run the app
|