Skip to content
Sign upLog in
← Back to Community

password protect a folder

Profile icon
AustinMoore4

is there a way to protect a folder so that others cant get into it. please do this in python.

Voters
Profile icon
KevDo
Profile icon
GeorgeGriffith1
Profile icon
JeremiahIS
Profile icon
AustinMoore4
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

try using .env files

try this link for more info.

https://dev.to/jakewitcher/using-env-files-for-environment-variables-in-python-applications-55a1

Profile icon
icodeletion

Use .env files. Read the docs the for more information.

Profile icon
Coder100

simple answer: you can't.
long answer: technically you can prevent people from seeing certain things, like secrets using .env

read: https://docs.repl.it/repls/secret-keys

Profile icon
SameeraMurthy

You can't password protect a folder in a repl. If your are looking to store credentials, you can make a .env file to store your credentials in instead. (.env files are automatically protected and private.)

Profile icon
SixBeeps

What kind of functionality do you want out of this folder?
Do you want read/write access while the folder is locked, or does it not matter?
Also, this is more of an OS question rather than a coding question. Replit runs on Ubuntu, so maybe do some research into password-protected folders on Ubuntu.

Profile icon
AustinMoore4

@SixBeeps
the folder should be readable to the account that owns that folder. if someone trys to open the folder in another account it should error( not the program)