Python Study, put_nowait(), get_nowait(), example source code

#put_nowait, get_nowait method

import queue
q = queue.Queue(2) #buffer size is 2
#q.put("orange")  # wait infinity until there is available space

#q.put_nowait("orange") #error occurs
# Line 187, in put_nowait return self.put(item, block=False)
# line 133, in put raise Full

#q.get_nowait() #error occurs
#line 195, in get_nowait return self.get(block=False)
#line 164, in get raise Empty

q.put("AA", True, 5);
q.put("AA", True, 5);
#q.put("AA", True, 5);  # wait 5 second until there is available space, if no space after 5 second, error occur


Popular posts from this blog

OpenCV Stitching example (Stitcher class, Panorama)

(OpenCV Study) Background subtractor MOG, MOG2, GMG example source code (BackgroundSubtractorMOG, BackgroundSubtractorMOG2, BackgroundSubtractorGMG)

Example source code of extract HOG feature from images, save descriptor values to xml file, using opencv (using HOGDescriptor )

Real-time N camera stitching Class.

8 point algorithm (Matlab source code) / The method to get the Fundamental Matrix and the Essential matrix

Optical Flow sample source code using OpenCV

Video Stabilization example source code, (using cvFindHomography, cvWarpPerspective functions in openCV)

(OpenCV Study) calcOpticalFlowFarneback example source code ( dense optical flow )

yuv422(YUYV) to RGB and RGB to yuv422(YUYV), (Using OpenCV and TBB)

(C, C++) TinyXML , xml read & write