Kvikontent commited on
Commit
f486ddd
·
verified ·
1 Parent(s): ea093d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -11
app.py CHANGED
@@ -1,7 +1,11 @@
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
 
@@ -20,13 +24,13 @@ 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:
@@ -36,13 +40,13 @@ if create:
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}")
@@ -50,6 +54,6 @@ if login:
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}")
 
1
  import streamlit as st
 
2
  import string
3
 
4
+ user_name = []
5
+ user_token = []
6
+ user_balance = []
7
+ count = len(user_name)
8
+
9
  def generate_api_token(length):
10
  characters = string.ascii_letters + string.digits
11
 
 
24
  price = "587$"
25
 
26
  if create:
27
+ index = count += 1
28
  user_token = generate_api_token(16)
29
 
30
+ user_name.append(name)
31
+ user_token.append(user_token)
32
+ user_balance.append(0)
33
+ balance = user_balance[index]
34
 
35
  st.header(f"Welcome, {name}", divider="rainbow")
36
  with account:
 
40
  with deposit:
41
  st.subheader("Deposid money to wallet.")
42
  how = st.number_input("Enter how much")
43
+ user_balance[index] += how
44
  with price:
45
  st.header(f"Current KVI Crypto price is {price}")
46
  if login:
47
+ if tok_inp in user_token:
48
+ innd = user_token.index(tok_inp)
49
+ name = user_name[innd]
50
  st.header(f"Welcome, {name}", divider="rainbow")
51
  with account:
52
  st.write(f"Your token: {user_token}")
 
54
  with deposit:
55
  st.subheader("Deposid money to wallet.")
56
  how = st.number_input("Enter how much")
57
+ user_balance[innd] += how
58
  with price:
59
  st.header(f"Current KVI Crypto price is {price}")