¿ªÔÆÌåÓý

Re: How do I import openpyxl?


 

Would it help to ditch the excel file and store the car information in the roster instead?

You'd need to have 600 (necessarily long) dummy addresses to use. Having the cars? in a separate roster group would keep them from getting tangled with your actual locos.

If your car data can be massaged to fit in an entry in the roster I think you'd be good to go, since you'd no longer need an excel interface at all.

Wouter


On Thu, 22 May 2025, 21:55 Phil G via , <phil=[email protected]> wrote:
You can manage Excel files as .csv as well as .xls - just choose the format when you save the file

Phil G

On 22 May 2025, at 21:43, Nick Brownsberger via <nbrownsbe=[email protected]> wrote:

?
Dave,
?
To answer your question, I have an Excel spreadsheet listing about 600 cars with various information about them like type, road, number, etc. I'm using a barcode reader to identify a car ID as it rolls over a hump and send it to a Jython program. The program gets some car related information out of the spreadsheet such as car length and destination. Then it looks up the train and classification track assigned for that destination and throws turnouts to send the car to the right track.
?
Right now, using openpyxl, the program works outside of jmri to get the track I need, but it can't throw turnouts without being inside jmri.
?
It doesn't sound like openpyxl is compatible with jmri and Apache POI is way over my head.
?
I'm looking at using csv files, but manipulating a 600 record csv file sounds daunting. Or, I could instantiate a class of 600 cars in the Jython program which I was trying to avoid. I'm also rethinking my strategy as well.
?
Thanks to all,
Nick
?

Join [email protected] to automatically receive all group messages.