Kvikontent commited on
Commit
de3835e
·
verified ·
1 Parent(s): fa8a710

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +55 -0
app.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import datas
3
+ import string
4
+
5
+ def generate_api_token(length):
6
+ characters = string.ascii_letters + string.digits
7
+
8
+ api_token = ''.join(secrets.choice(characters) for _ in range(length))
9
+
10
+ return api_token
11
+
12
+ st.sidebox.title("KVI Crypto", help="IT IS FAKE!! Just for research")
13
+ st.sidebox.write("New crypto money")
14
+ name = st.sidebox.text_input("Enter name")
15
+ create = st.sidebox.button("Create wallet")
16
+ tok_inp = st.text_input("Enter token to login")
17
+ login = st.button("Login")
18
+
19
+ account, deposit, price = st.tabs(5)
20
+ price = "587$"
21
+
22
+ if create:
23
+ index = datas.count += 1
24
+ user_token = generate_api_token(16)
25
+
26
+ datas.user_name.append(name)
27
+ datas.user_token.append(user_token)
28
+ datas.user_balance.append(0)
29
+ balance = datas.user_balance[index]
30
+
31
+ st.header(f"Welcome, {name}", divider="rainbow")
32
+ with account:
33
+ st.write(f"Your token: {user_token} . Remember it or copy!!")
34
+ st.header(f"Your balance: {balance}")
35
+ st.number_input
36
+ with deposit:
37
+ st.subheader("Deposid money to wallet.")
38
+ how = st.number_input("Enter how much")
39
+ datas.user_balance[index] += how
40
+ with price:
41
+ st.header(f"Current KVI Crypto price is {price}")
42
+ if login:
43
+ if tok_inp in datas.user_token:
44
+ innd = datas.user_token(tok_inp)
45
+ name = datas.user_name[innd]
46
+ st.header(f"Welcome, {name}", divider="rainbow")
47
+ with account:
48
+ st.write(f"Your token: {user_token}")
49
+ st.header(f"Your balance: {balance}")
50
+ with deposit:
51
+ st.subheader("Deposid money to wallet.")
52
+ how = st.number_input("Enter how much")
53
+ datas.user_balance[innd] += how
54
+ with price:
55
+ st.header(f"Current KVI Crypto price is {price}")