Skip to content

Tag: python-3.7

List available cameras OpenCV/Python

I have multiple webcams connected to my PC and I would like to select one camera based on its info (name, resolution etc.). Is there a way to list all the cameras available on a PC, instead of trying all the indices in cv2.VideoCapture()? Answer The answer is negative. OpenCV doesn’t have a method for l…

Handle specific exception from python package

I would like to handle the following Exception from py_vollib/py_lets_be_rational in specific way. Tried this without success: what am I doing wrong? any help would be appreciated. Answer Looking at the implementation, you’re missing the period at the end of the sentence: I don’t see the point in …

Installing numpy with pip on windows 10 for python 3.7

I installed python 3.7 on my Windows 10 laptop since it has been officially released as of today (06/28/2018). Then i tried to install numpy package using pip The install proceeds but finally fails with the below error : Any ideas as to how to overcome this install Error? Thanks. Answer Installing NumPy on Wi…

Dataclasses and property decorator

I’ve been reading up on Python 3.7’s dataclass as an alternative to namedtuples (what I typically use when having to group data in a structure). I was wondering if dataclass is compatible with the property decorator to define getter and setter functions for the data elements of the dataclass. If s…