I have an issue when importing pandas and running the script on windows task scheduler. In the end the program just hangs and no error occurs. When I execute the script in command prompt, there's no problem. I've tried a lot of different things but couldn't fix the problem so far.
What I'm looking for now is a way to import pandas in verbose mode and write the output real time to a file. I've found a lot of explanations to do this with e.g. python -v module.py 2> output.txt in the shell. But what I'd like to do is something like this:
with profiler as context:
import pandas
with open("output.txt", "w+") as file:
file.write(context.output())
The script should write the output in real time so that I can kill the task an still have the output until the program is hanging.