The code:
#Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import fitz
import io
import streamlit as st
global path_input_0 #HERE ASSIGNMENTS-------------------------------
path_input_0=""
path_input_last=""
def login():
# interface codes for the login screen
path_input_0 =st.text_input("File Path:", "Please enter the path to the folder containing the Abstract_Account_Web_App.py file")
st.write(path_input_0)
global proceed
if st.button("Proceed"):
st.session_state["page"] = "main"
st.balloons()
st.experimental_rerun()
return path_input_0
def main():
# interface codes for the main screen
pathz=path_input_last+"/Bankomat Alışveriş Özeti.pdf"
st.write("path1:",pathz)
file_names = [r'%s' % pathz]
st.write(file_names)
if __name__=='__main__':
if "page" not in st.session_state:
st.session_state["page"] = "login"
if st.session_state["page"] == "login":
path_input_last=login()
st.write("last:",path_input_last)
elif st.session_state["page"] == "main":
st.balloons()
main()
Main screen: (First login screen, after main screen)

Hello friends, I’m trying to take the path from the login screen and use it on the main screen. The login function returns the path_input_0 from the user. But I can’t get this output and use it in the main function Pathz=path_input_last+“/Bankomat Alışveriş Özeti.pdf”. Main function’s path_input_last comes as null.(“”) So it just prints path1 as /Bankomat Alışveriş Özeti.pdf. I don’t want that. The full file path is not coming.
Secondly, file_names = [r'%s' %pathz] looks weird in the interface. My goal here was to take the file path as a variable and read it properly.
If I call login inside the main function again, I can get the variables I want, but this time the problem of calling the two interfaces together arises. It breaks this as my goal is to fetch the interfaces in order
How Can I solve these problems? Could you explain the solution?