Insert timestamp with a python script

Discussions on extending SharpCap using the built in Python scripting functionality
User avatar
admin
Site Admin
Posts: 13523
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Insert timestamp with a python script

#11

Post 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
michastro
Posts: 19
Joined: Wed Jan 22, 2020 12:10 pm

Re: Insert timestamp with a python script

#12

Post 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
michastro
Posts: 19
Joined: Wed Jan 22, 2020 12:10 pm

Re: Insert timestamp with a python script

#13

Post 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
User avatar
admin
Site Admin
Posts: 13523
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Insert timestamp with a python script

#14

Post 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
pamino
Posts: 6
Joined: Tue Feb 14, 2023 2:19 pm

Re: Insert timestamp with a python script

#15

Post 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
User avatar
admin
Site Admin
Posts: 13523
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Insert timestamp with a python script

#16

Post 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
michastro
Posts: 19
Joined: Wed Jan 22, 2020 12:10 pm

Re: Insert timestamp with a python script

#17

Post 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
Jean-Francois
Posts: 417
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Insert timestamp with a python script

#18

Post 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
michastro
Posts: 19
Joined: Wed Jan 22, 2020 12:10 pm

Re: Insert timestamp with a python script

#19

Post 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
Jean-Francois
Posts: 417
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Insert timestamp with a python script

#20

Post 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
Post Reply