I got the Serial module to work
Posted: Sat Feb 07, 2026 4:39 pm
I wanted to get the serial module in python to work being called from a Sequencer script. I realize that I will need to disconnect the focuser in order to be able to access it thru the python script but that is not a problem as I will only be doing it one or two times a night.
I have been programming since the days of MS DOS and was a prolific bat file programmer and wondered if I started the python script from a batch file if it would run under the admin account.
What I did was use the Sequencer "Run this python script" to start a python script that starts a DOS bat file with only two calls:
import os
os.system("c:\\Users\\user\\Documents\\SerialComm.bat")
The bat file just runs my python script with the call to serial and other code to access the focuser but it uses the system path for python and can see all the python modules and therefore runs properly.
py c:\Users\user\Documents\GetStatus.py
The only drawback is having to disconnect/reconnect the focuser but since that only occurs a few times it should not be a problem.
I have been programming since the days of MS DOS and was a prolific bat file programmer and wondered if I started the python script from a batch file if it would run under the admin account.
What I did was use the Sequencer "Run this python script" to start a python script that starts a DOS bat file with only two calls:
import os
os.system("c:\\Users\\user\\Documents\\SerialComm.bat")
The bat file just runs my python script with the call to serial and other code to access the focuser but it uses the system path for python and can see all the python modules and therefore runs properly.
py c:\Users\user\Documents\GetStatus.py
The only drawback is having to disconnect/reconnect the focuser but since that only occurs a few times it should not be a problem.