I have a script which reads a CSV file created within Excel to automate my layout.
Each row in the file describes a section in the layout such as blocks, sensors, turnouts, turnout state, signal etc.
?
Path to the file is self.routeSelFile = (self.retval+"/Routes/Live/"+self.filename) - I run this on two PCs (not concurrently) and self.retval is the path for a specific PC, self.filename is the route selection from a drop-down.
File is opened with self.sens_file = open(self.routeSelFile, "r")
And closed when the script terminates with? self.sens_file.close()
There are other clean up routines called when the script terminates with status messages so I am confident the close() is being performed.
?
The script works fine (although lots of functionality still in development) and I run an instance (if that's the correct word) of the script to control each loco.
?
When open a CSV file using Excel due to a typo or modification if that file has been previously opened by a script Excel will not allow me to save the updated CSV file with the same name, it states that someone else is using the file and offers to save a copy or cancel.
It does not come up with the usual Excel message of "open in read only" when I open the file or any other warning, only when I try to save it.
?
This is the case even if I just run one instance of the script and then terminate it properly.
There is no error message in the console.
?
I can save the CSV file with the same name and no error if I quit PanelPro
?
I wonder if there is something that I should also be doing in Windows to reset a flag or something else?
?
Any advice welcome, thanks
Pete
?
PanelPro 5.8+Rbc21ce2ce
Java 11.0.13
Windows 10 Pro 64
Excel 2019
?
?
?