Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,53 +9,42 @@ count = len(user_name)
|
|
9 |
|
10 |
def generate_api_token(length):
|
11 |
characters = string.ascii_letters + string.digits
|
12 |
-
|
13 |
api_token = ''.join(secrets.choice(characters) for _ in range(length))
|
14 |
-
|
15 |
return api_token
|
16 |
|
17 |
st.sidebar.title("KVI Crypto", help="IT IS FAKE!! Just for research")
|
18 |
st.sidebar.write("New crypto money")
|
19 |
name = st.sidebar.text_input("Enter name")
|
20 |
create = st.sidebar.button("Create wallet")
|
21 |
-
tok_inp = st.text_input("Enter token to login")
|
22 |
-
login = st.button("Login")
|
23 |
|
24 |
-
account, deposit, price = st.
|
25 |
-
|
26 |
|
27 |
if create:
|
28 |
-
|
29 |
-
user_token = generate_api_token(16)
|
30 |
|
31 |
user_name.append(name)
|
32 |
-
user_token.append(
|
33 |
user_balance.append(0)
|
34 |
index = count
|
35 |
balance = user_balance[index]
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
st.number_input
|
42 |
-
with deposit:
|
43 |
-
st.subheader("Deposid money to wallet.")
|
44 |
-
how = st.number_input("Enter how much")
|
45 |
-
user_balance[index] += how
|
46 |
-
with price:
|
47 |
-
st.header(f"Current KVI Crypto price is {price}")
|
48 |
-
if login:
|
49 |
if tok_inp in user_token:
|
50 |
innd = user_token.index(tok_inp)
|
|
|
51 |
name = user_name[innd]
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
st.header(f"Current KVI Crypto price is {price}")
|
|
|
9 |
|
10 |
def generate_api_token(length):
|
11 |
characters = string.ascii_letters + string.digits
|
|
|
12 |
api_token = ''.join(secrets.choice(characters) for _ in range(length))
|
|
|
13 |
return api_token
|
14 |
|
15 |
st.sidebar.title("KVI Crypto", help="IT IS FAKE!! Just for research")
|
16 |
st.sidebar.write("New crypto money")
|
17 |
name = st.sidebar.text_input("Enter name")
|
18 |
create = st.sidebar.button("Create wallet")
|
19 |
+
tok_inp = st.sidebar.text_input("Enter token to login")
|
20 |
+
login = st.sidebar.button("Login")
|
21 |
|
22 |
+
account, deposit, price = st.columns(3)
|
23 |
+
price_value = 587
|
24 |
|
25 |
if create:
|
26 |
+
new_user_token = generate_api_token(16)
|
|
|
27 |
|
28 |
user_name.append(name)
|
29 |
+
user_token.append(new_user_token)
|
30 |
user_balance.append(0)
|
31 |
index = count
|
32 |
balance = user_balance[index]
|
33 |
|
34 |
+
account.write(f"Your token: {new_user_token}. Remember it or copy!!")
|
35 |
+
account.header(f"Your balance: {balance}")
|
36 |
+
|
37 |
+
elif login:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
if tok_inp in user_token:
|
39 |
innd = user_token.index(tok_inp)
|
40 |
+
balance = user_balance[innd]
|
41 |
name = user_name[innd]
|
42 |
+
|
43 |
+
account.write(f"Your token: {tok_inp}")
|
44 |
+
account.header(f"Your balance: {balance}")
|
45 |
+
|
46 |
+
deposit.subheader("Deposit money to wallet.")
|
47 |
+
how_much = deposit.number_input("Enter how much")
|
48 |
+
user_balance[innd] += how_much
|
49 |
+
|
50 |
+
price.header(f"Current KVI Crypto price is {price_value}$")
|
|