Page 2 of 3

Re: Insert timestamp with a python script

Posted: Fri May 12, 2023 12:32 pm
by admin
Hi Michel

Should I really be telling you how to hand over control to NINA :D ?

Actually, it's fairly easy

Code: Select all

SharpCap.SelectedCamera = None
cheers,

Robin

Re: Insert timestamp with a python script

Posted: Fri May 12, 2023 2:05 pm
by michastro
Hello,
I am sorry, I program in Delphi, C++ and C#, but I never use Python, so I make some try, sometime it's working, sometime not!!
Thanks again
Michel

Re: Insert timestamp with a python script

Posted: Mon May 15, 2023 3:52 pm
by michastro
Thanks a lot Robin, now the script in python can start from a .bat, BUT, there is a blocking windows that tells that it's a beta version before the script, so it's unusable. A last thing too, I try to close Sharpcap with a python instruction, but I am still stupid in Python, I can't find it.
Thanks
Regards
Michel

Re: Insert timestamp with a python script

Posted: Mon May 15, 2023 9:13 pm
by admin
Hi Michel,

well, closing SharpCap was supposed to be SharpCap.ExitApplication(), but it doesn't work right. I will look into it.

I will also see if I can supress the beta version box if the /runscript parameter is specified.

cheers,

Robin

Re: Insert timestamp with a python script

Posted: Tue May 16, 2023 9:59 am
by pamino
Is it possible to pass arguments to a python ironscript?, for example time exposition....
i mean something like that:

Code: Select all

"C:\Program Files\SharpCap 4.1 (64 bit)" SharpCap.exe /runscript C:\Occultation.py 30

Re: Insert timestamp with a python script

Posted: Tue May 16, 2023 12:31 pm
by admin
Hi,

no, there's no option to pass a parameter, but you should be able to work around that problem...

* Make your batch file write whatever parameters are needed to a file somewhere on disk
* Make your python script read the parameters from file as it is starting.

cheers,

Robin

Re: Insert timestamp with a python script

Posted: Tue May 16, 2023 12:32 pm
by michastro
I have tried without success, but I am not a reference in Python. Otherwise for instance, launch a python script directlt at the start of SharpCap works only with beta 4.1 version, and there is az confirmation message of Sharpcap before the start, so not very usefull, but Robin works on it, and again thanks to his wonderfull job. And as Robin says, you can use a file to save the desired values.
Michel

Re: Insert timestamp with a python script

Posted: Tue May 16, 2023 6:23 pm
by Jean-Francois
Hello Michel,

Are you register to the OccultWatcher or OWCloud io.group ?

My script for the occultation capture from SharpCap is fast finished. Here a presentation of the script (and the OccultWatcher new add-in):

https://groups.io/g/OccultWatcher/topic ... 2765899686

Regards,
Jean-Francois

Re: Insert timestamp with a python script

Posted: Tue May 16, 2023 6:30 pm
by michastro
Hello Jean-François,
My goal is to have an automatic session with NINA. For example, take pictures during the night, after at a precise hour point in the direction of occultation, next launch automaticly Sharpcap with a script in Python, and after come back to NINA and continue the night. All these things automaticly, and during that, I can sleep.
Michel

Re: Insert timestamp with a python script

Posted: Tue May 16, 2023 6:39 pm
by Jean-Francois
Hello Michel,

OK, I understand.
My script will wait until some time before the occultation event and then start the capture.

Maybe ... you can do the opposite ... use SharpCap for "commanding" NINA :)

Jean-Francois