Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
- admin
- Site Admin
- Posts: 13483
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hi folks,
The Python scripting in SharpCap has been running Python 2.7 up to now, but finally there is a version of IronPython available that supports Python 3.4 - I have now incorporated this into SharpCap 4.1 beta.
Python scripts may need updating to reflect the change from Python 2.7 to Python 3.4 (in particular, 'print x' becomes 'print(x)' ).
I have added the same site-packages to the standard python library packages as before - that is 'six' and 'pyro4'. If any scripting users have ideas for useful additional default packages (must be small, and pure python rather than using native libraries), please let me know.
cheers,
Robin
The Python scripting in SharpCap has been running Python 2.7 up to now, but finally there is a version of IronPython available that supports Python 3.4 - I have now incorporated this into SharpCap 4.1 beta.
Python scripts may need updating to reflect the change from Python 2.7 to Python 3.4 (in particular, 'print x' becomes 'print(x)' ).
I have added the same site-packages to the standard python library packages as before - that is 'six' and 'pyro4'. If any scripting users have ideas for useful additional default packages (must be small, and pure python rather than using native libraries), please let me know.
cheers,
Robin
-
- Posts: 415
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hello Robin,
OK, good news to actualize the Python scripting in SharpCap.
But, we will have the same problem with some "standard" module that are compiled with C code (for example numpy or scipy).
I guess that astropy has C code too.
Concerning numpy and scipy ... I found some time ago an internet page with a C# version of numpy/scipy.
I tried it, but it was not working properly. Maybe you can use it for IronPython 3.4 in SharpCap.
I did some test with "OxyPlot.dll" as alternative to "MatplotLib".
I found the "Meta.Numerics.dll" as alternative of numpy.
One other point ... Do you know how to save the IronPython Console and Pad settings ?
I use "#" for showing the line number, "Pad - ConvertTabToSpaces" and "Pad - ShowSpaces".
It is each time necessary to change the settings manually. If it is not in the Console itself, it could be somewhere in a parameter file.
Maybe it will be possible in the version 3.4.
Regards,
Jean-Francois
OK, good news to actualize the Python scripting in SharpCap.
But, we will have the same problem with some "standard" module that are compiled with C code (for example numpy or scipy).
I guess that astropy has C code too.
Concerning numpy and scipy ... I found some time ago an internet page with a C# version of numpy/scipy.
I tried it, but it was not working properly. Maybe you can use it for IronPython 3.4 in SharpCap.
I did some test with "OxyPlot.dll" as alternative to "MatplotLib".
I found the "Meta.Numerics.dll" as alternative of numpy.
One other point ... Do you know how to save the IronPython Console and Pad settings ?
I use "#" for showing the line number, "Pad - ConvertTabToSpaces" and "Pad - ShowSpaces".
It is each time necessary to change the settings manually. If it is not in the Console itself, it could be somewhere in a parameter file.
Maybe it will be possible in the version 3.4.
Regards,
Jean-Francois
- admin
- Site Admin
- Posts: 13483
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hi,
yes, Numpy/SciPy and AstroPy are all out I'm afraid (NumPy uses C code, and the other two depend on it). Anyway, they are several megabytes each, so too big for me to package with the SharpCap install, even if they were usable
I can see the toggle buttons for line numbers and showing line breaks in the lower pad area, but nothing there related to showing spaces or tabs to spaces? Am I missing something? The only tabs/spaces things I can find are for the upper console area?
cheers,
Robin
yes, Numpy/SciPy and AstroPy are all out I'm afraid (NumPy uses C code, and the other two depend on it). Anyway, they are several megabytes each, so too big for me to package with the SharpCap install, even if they were usable
I can see the toggle buttons for line numbers and showing line breaks in the lower pad area, but nothing there related to showing spaces or tabs to spaces? Am I missing something? The only tabs/spaces things I can find are for the upper console area?
cheers,
Robin
-
- Posts: 415
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hello Robin,
You can change some settings for the upper part (Console) or lower part (Pad):
Regards,
Jean-Francois
You can change some settings for the upper part (Console) or lower part (Pad):
Regards,
Jean-Francois
- admin
- Site Admin
- Posts: 13483
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Ahah!
I did not notice that the top thing in the slide out panel was a drop down and allowed you to switch between console and pad!
I will see what can be done.
cheers,
Robin
I did not notice that the top thing in the slide out panel was a drop down and allowed you to switch between console and pad!
I will see what can be done.
cheers,
Robin
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Could you update the help file to reflect the new version of Python please ?
Steve.
Steve.
- admin
- Site Admin
- Posts: 13483
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hi Steve,
oops, I hadn't noticed that the old 'print XXXX' rather that 'print(XXXX)' was still in the documentation. Annoyingly it is present in some of the screenshots too, so those will need to be replaced Thanks for pointing it out.
cheers,
Robin
oops, I hadn't noticed that the old 'print XXXX' rather that 'print(XXXX)' was still in the documentation. Annoyingly it is present in some of the screenshots too, so those will need to be replaced Thanks for pointing it out.
cheers,
Robin
-
- Posts: 7
- Joined: Sun Feb 25, 2024 4:11 pm
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hi
I am trying SharpCap 4.1.11804 64 bit and I cannot set the gain of the SelectedCamera
SharpCap.SelectedCamera.Controls.Gain.Value = Gain
How can I do that?
Thanks
I am trying SharpCap 4.1.11804 64 bit and I cannot set the gain of the SelectedCamera
SharpCap.SelectedCamera.Controls.Gain.Value = Gain
How can I do that?
Thanks
-
- Posts: 7
- Joined: Sun Feb 25, 2024 4:11 pm
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
I found why the Gain control is not there: It is because I was using Camera V3 Simulator who doesn't have a Gain control
- admin
- Site Admin
- Posts: 13483
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Python Scripting update to Python 3.4 in SharpCap 4.1 Beta
Hi,
with the ASCOM simulator camera, there is an option in the camera Setup to turn gain on or off (and switch between numeric gains and ISO gains). Note that SharpCap doesn't detect this changing unless you completely close and re-open the camera.
cheers,
Robin
with the ASCOM simulator camera, there is an option in the camera Setup to turn gain on or off (and switch between numeric gains and ISO gains). Note that SharpCap doesn't detect this changing unless you completely close and re-open the camera.
cheers,
Robin