Im my program, In fileA i ask the user to enter there username and if they say yes itll save their username to a .env file if not i want it to only be saved until the program is either closed or stopped. Then the program in fileB runs a script. If theyve said yes to storing their password itll get it from the .env. if not i want it to somehow get it from the other file somehow.
i tryed from fileA import username
in fileB but it ran fileA instead of getting the username variable. Which kinda makes sense to me but i would of assumed it would of just returned nothing as the username variable hasnt been set to anything in that instance of fileA.
I also found this Passing data between separately running Python scripts but none of the anwsers work as i dont have both of the files running at the same time.