May-07-2024, 03:12 PM
I'm on Windows 10, running Python 3.12.3. I created a python script in a directory called 'python_alarm_help', and it contains print statements that correctly print to the command line when I call it with 'python alarm_file_reader.py'.
Later, I created a second script in the directory just above 'python_alarm_help' (this higher directory is called '***_python', don't want to disclose the full name, but it does contain the string 'python', in case that matters). This script was called 'data_handler.py'. It also had print statements in it, but when using 'python data_handler.py', the print statements did not output anything, not even a blank line. Also, I had input calls within this script that DO output and successfully take in input to the script even when I run the script inside the higher '***_python' directory.
I solved this print issue by copying 'data_handler.py' into 'python_alarm_help' and re-running with 'python data_handler.py'. The print statements work again. I'm curious why this happened? If it matters, 'alarm_file_reader.py' was the first python script I wrote on this computer.
I also tried a couple other sys related solutions in the higher directory, but no luck. I'm guessing there's some sort of cache and/or a configuration file I need to be aware of. Thoughts on this?
Later, I created a second script in the directory just above 'python_alarm_help' (this higher directory is called '***_python', don't want to disclose the full name, but it does contain the string 'python', in case that matters). This script was called 'data_handler.py'. It also had print statements in it, but when using 'python data_handler.py', the print statements did not output anything, not even a blank line. Also, I had input calls within this script that DO output and successfully take in input to the script even when I run the script inside the higher '***_python' directory.
I solved this print issue by copying 'data_handler.py' into 'python_alarm_help' and re-running with 'python data_handler.py'. The print statements work again. I'm curious why this happened? If it matters, 'alarm_file_reader.py' was the first python script I wrote on this computer.
I also tried a couple other sys related solutions in the higher directory, but no luck. I'm guessing there's some sort of cache and/or a configuration file I need to be aware of. Thoughts on this?