Skip to content
Stocks Simulator
Profile icon
RishiMohanty

Stocks Simulator:

-Buy Stocks
-Sell Stocks
-Go Big or Go Home

CAN YOU GET ON THE LEADERBOARD??

You are viewing a single comment. View All
Profile icon
MrVoo

Replit database doesn't work with console projects.

Profile icon
RishiMohanty

@MrVoo
Really? Hmmm... It Works If I Run It

Profile icon
MrVoo

@RishiMohanty
That's because you own the repl :P

Profile icon
ch1ck3n

@MrVoo
stop sending false information

Repl database works whoever is running the project, and even on console projects!

Profile icon
RishiMohanty
Profile icon
MrVoo

@ch1ck3n
Then how come it never works that way for me? :/

Profile icon
RishiMohanty

@MrVoo
Your Probably doing it wrong

Profile icon
RishiMohanty

@MrVoo

https://docs.replit.com/hosting/database-faq

from replit import db

Insert →
Set
a key to a value
db["
key
"] = "
value
"

Insert →
Get
a key's value
value = db["
key
"]

Insert →
Delete
a key
del db["
key
"]

Insert →
List
all keys
keys = db.keys()

Insert →
List
keys with a prefix
matches = db.prefix("
prefix
")

Insert →

Profile icon
MrVoo

@RishiMohanty
@ch1ck3n
This project doesnt work for me because of replit database, I think it needs to be a web server project, not 100% console

Profile icon
ch1ck3n
Profile icon
RishiMohanty

@MrVoo
Does It Give You an error? if it does what is the error

Profile icon
RishiMohanty

@ch1ck3n
It gave an error since you forgot to set an initial value to 'poop'. I fixed it through the console

Profile icon
ch1ck3n

@RishiMohanty
haha you said poop

Profile icon
MrVoo

@ch1ck3n
funniiiiiiiiiiiiiiiiiii

Profile icon
RishiMohanty

@MrVoo
uhhhhhhhhhhhhhhhhhhh... Okay?