Skip to content
← Back to Community
Collapse
Profile icon
NeilShah1

Whenever I Collapse A Code Block And Re-Load The Page, It
Un-Collapses, How Do I Fix This?

Voters
Profile icon
samuel1111
Profile icon
NeilShah1
Comments
hotnewtop
Profile icon
InvisibleOne

Save whether that block is collapsed or uncollapsed, then when you first load the page, check if it should be collapsed or uncollapsed and then collapse or uncollapse it.

Profile icon
NeilShah1

@InvisibleOne How do I save?

Profile icon
InvisibleOne

in python? It depends on how complicated you want to be. You can easily save by storing text in a text file, using replit db, or if you can use some other database like MongoDB (maybe NoSQL or MySQL but I've never used them with python) @NeilShah1

Profile icon
RowanFromBJC

I don't think you can.