Run Python script with SQLite commands on startup
#1
Hi guys

I have a Python script with some SQLite3 commands which runs through the tables in TV29.db file, hides all channel lists except 'All channels', hides a large number of channels and then sorts them in a particular order.
I would like to make this script run automatically at startup, but I can't figure out how to do it.

It's not a big deal on my Windows computer as I can double click the script before running Kodi and everything is fine. But I can't do the same on my Android device.

Can anyone help, please?

Thanks in advance!
Reply
#2
(2020-10-24, 21:22)djokenzi Wrote: Hi guys

I have a Python script with some SQLite3 commands which runs through the tables in TV29.db file, hides all channel lists except 'All channels', hides a large number of channels and then sorts them in a particular order.
I would like to make this script run automatically at startup, but I can't figure out how to do it.

It's not a big deal on my Windows computer as I can double click the script before running Kodi and everything is fine. But I can't do the same on my Android device.

Can anyone help, please?

Thanks in advance!

If you want it to start with Kodi you can leverage an autoexec.py in the userdata folder.  I do this to position Kodi with the window and content I want to display on startup. 


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#3
@jbinkley60 Isn't this method deprecated? I tried it already, but it didn't work for me...
Reply
#4
(2020-10-24, 22:18)djokenzi Wrote: @jbinkley60 Isn't this method deprecated? I tried it already, but it didn't work for me...

There is a newer autoexec service but as far as I know autoexec.py still works.  What specifically isn't working ? Can you post your autoexec.py file ?


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#5
Hi Jeff,

You were right, it's working! In my version of Kodi there are two userdata folders, and I wasn't aware of that, so it turned out that I wasn't using the correct one...

Thanks for your comment, it really helped!
Reply
#6
(2020-10-25, 00:40)djokenzi Wrote: Hi Jeff,

You were right, it's working! In my version of Kodi there are two userdata folders, and I wasn't aware of that, so it turned out that I wasn't using the correct one...

Thanks for your comment, it really helped!

Excellent.  Glad it is working for you.  Yes, depending upon what Kodi is running on the correct location of the userdata folder varies.  You should be able to use this technique on both your Windows and Android installations. 

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Run Python script with SQLite commands on startup0