Jun-15-2020, 02:24 PM
Hello,
my knowledge of python is rather limited so I might just be poking in the dark...
What I am attempting to do is open a file, write some stuff in it and close it.
The problem I have is, what if that file is opened?
To fit my needs, it needs to be closed, no matter what's happening to it, so I can open it via python application.
So if I cant open a file that's open, I can try to force close it and then open it via python?
Found this lib: https://psutil.readthedocs.io/en/latest/
It kind of does what I want, maybe I'm just missing on the how.
It currently returns me a list of all processes, and gives me ids that I can use to kill processes.
While in reality, I would like to close test.csv that is open in excel instead of closing all of excel, any ideas how I
can achieve that?
my knowledge of python is rather limited so I might just be poking in the dark...
What I am attempting to do is open a file, write some stuff in it and close it.
The problem I have is, what if that file is opened?
To fit my needs, it needs to be closed, no matter what's happening to it, so I can open it via python application.
So if I cant open a file that's open, I can try to force close it and then open it via python?
Found this lib: https://psutil.readthedocs.io/en/latest/
It kind of does what I want, maybe I'm just missing on the how.
It currently returns me a list of all processes, and gives me ids that I can use to kill processes.
While in reality, I would like to close test.csv that is open in excel instead of closing all of excel, any ideas how I
can achieve that?