Python Library Installation

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
lightpath
Posts: 4
Joined: Thu Dec 21, 2017 3:47 am

Python Library Installation

Post by lightpath » Fri Mar 23, 2018 2:30 am

Hey there fellow scripters-

I'm working on an all-sky camera script and I was wondering if there's a way to install 3'rd party libs into IronPython. In particular I was looking at Astral, so I could know when the sun is up, and disable dark frames for example.

Does anyone know a better way to do this within the tools that ship with Ironpython in Sharpcap?

Thanks very much for putting IronPython into SharpCap by the way- It's wonderful!

Mark.

User avatar
admin
Site Admin
Posts: 4492
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Python Library Installation

Post by admin » Fri Mar 23, 2018 6:58 am

Hi Mark,

glad you like the IronPython scripting :)

I think it should be fairly simple - just use sys.path.append('c:\my library') to make IronPython search for imports in an additional folder (see https://stackoverflow.com/questions/314 ... her-source).

Iron Python can only load external modules that are pure python (not ones that have C/C++ components), so you have to be careful of that. I expect that if you set up a separate install of python 2.7 and 'pip install' the modules you want into that, you may just be able to point SharpCap at it's module directory.

cheers,

Robin

lightpath
Posts: 4
Joined: Thu Dec 21, 2017 3:47 am

Re: Python Library Installation

Post by lightpath » Sat Mar 24, 2018 9:45 pm

Those are neat solutions, I'll give them a try! Thanks Robin!

Mark.

lightpath
Posts: 4
Joined: Thu Dec 21, 2017 3:47 am

Re: Python Library Installation

Post by lightpath » Sun Mar 25, 2018 4:07 am

Unfortunately the dependencies got irritating for Astral. I'm going to try and solve this problem another way. Your solution did work, however, thanks!

TimHaymes
Posts: 19
Joined: Sun May 28, 2017 8:11 am

Re: Python Library Installation / access to system time?

Post by TimHaymes » Thu Jan 23, 2020 11:27 pm

I have a question about scripting. Is it possible to pole the system time, so that I can write a script that will enable me to start an SER recording at a specified time for a specified duration ? I use the QHY174m-GPS. Based on what I have read here, it may be possible to include additional libraries. Any suggestion/example welcome.

Im not a regular scripter, i just hack examples ;) Infact, i have not used ironPython.

Tim

User avatar
admin
Site Admin
Posts: 4492
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Python Library Installation

Post by admin » Sat Jan 25, 2020 8:02 pm

Hi,

Yes, you can definitely do something like this to wait until a certain time. There are examples in all sorts of places on the web showing how to do this with Python that can be reused in SharpCap – for instance one approach is shown here

https://stackoverflow.com/questions/448 ... rtain-time

Hope this helps, Robin

Post Reply