import streamlit as st
import get_todos
todos = get_todos.getTodos()
def add_todos():
todo1 = st.session_state["new_todo"] + "\n"
todos.append(todo1)
get_todos.writeTodos(todos)
st.title("My TO-DO App")
...
def getTodos():
with open("docs.txt", "r") as file:
data = file.readlines()
return data
def writeTodos(adder):
with open("docs.txt", "w") as file:
file.writelines(adder)
I built a TO-DO App in Python using streamlit
While performing this task in terminal, it's continuously showing
'FileNotFoundError'
meanwhile the file actually exist.
What could be the problem ? Any syntax error? or Logical Error?
The main purpose of virtual environments or venv
is to manage settings and dependencies of a particular project regardless of other Python projects. virtualenv tool comes bundled with PyCharm, so the user doesn't need to install it. It is always found in the project directory named venv
which should be a unique folder design to fulfil a specific purpose.
Note: No external file(s) should be added to the venv
folder.
This clearly indicates that your structure is not appropriate. I will recommend you visit pycharm project structure to read more about configuration of virtual environments. You should restructure your project properly. It might feel like a pain on the neck but I bet it worth it.
Attention:
All the external files you added to venv
should rather be in your samik
folder which is your project main folder.