File size: 757 Bytes
91108e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st
import os

# Function to read the counter
def read_counter():
    if os.path.exists("counter.txt"):
        with open("counter.txt", "r") as f:
            return int(f.read())
    else:
        return 0

# Function to update the counter
def update_counter():
    current_count = read_counter() + 1
    with open("counter.txt", "w") as f:
        f.write(str(current_count))
    return current_count

# Streamlit UI
st.title("Contract Analysis App")

# Display current usage count
current_count = read_counter()
st.write(f"App has been used **{current_count}** times.")

# Button to analyze contract
if st.button("Analyze Contract"):
    new_count = update_counter()
    st.success(f"Contract analyzed! Total app usage: {new_count}")