Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print() is a function in Python 3 #150

Open
cclauss opened this issue Oct 16, 2018 · 2 comments
Open

print() is a function in Python 3 #150

cclauss opened this issue Oct 16, 2018 · 2 comments
Labels

Comments

@cclauss
Copy link

cclauss commented Oct 16, 2018

flake8 testing of https://github.com/spmallick/learnopencv on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./tracking/tracker.py:4:68: E999 SyntaxError: invalid character in identifier
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
                                                                   ^
./HeadPose/headPose.py:42:29: E999 SyntaxError: invalid syntax
print "Camera Matrix :\n {0}".format(camera_matrix);
                            ^
./heatmap/generate_heatmap.py:121:33: E999 SyntaxError: invalid syntax
            print "processing %s" % frame_path
                                ^
./ImageAlignment/image_alignment.py:33:12: E999 SyntaxError: invalid syntax
    print sz
           ^
./Delaunay/delaunay.py:49:14: F821 undefined name 'xrange'
    for i in xrange(0,len(facets)) :
             ^
./EigenFace/EigenFace.py:63:26: E999 TabError: inconsistent use of tabs and spaces in indentation
		print("No images found")
                         ^
./ninjaEyeDetector/ninjaEyeDetector.py:38:14: F821 undefined name 'xrange'
    for i in xrange (0,len(faces)):
             ^
./RotationMatrixToEulerAngles/rotm2euler.py:85:39: E999 SyntaxError: invalid syntax
    print "\nInput Euler angles :\n{0}".format(e)
                                      ^
./imread/imread_examples.py:6:37: E999 SyntaxError: invalid syntax
print "flags :  cv2.IMREAD_GRAYSCALE"
                                    ^
./FacialAttractiveness/source/trainModel.py:25:10: E999 SyntaxError: invalid syntax
print corr
         ^
./FacialAttractiveness/source/cross_validation.py:24:8: E999 SyntaxError: invalid syntax
	print i
       ^
./FaceAverage/faceAverage.py:125:22: F821 undefined name 'xrange'
            for j in xrange(0, 3):
                     ^
./FaceAverage/faceAverage.py:126:26: F821 undefined name 'xrange'
                for k in xrange(0, len(points)):                    
                         ^
./FaceAverage/faceAverage.py:166:14: F821 undefined name 'xrange'
    for i in xrange(0, 3):
             ^
./FaceAverage/faceAverage.py:225:14: F821 undefined name 'xrange'
    for i in xrange(0, numImages):
             ^
./FaceAverage/faceAverage.py:264:14: F821 undefined name 'xrange'
    for i in xrange(0, len(imagesNorm)) :
             ^
./FaceAverage/faceAverage.py:267:18: F821 undefined name 'xrange'
        for j in xrange(0, len(dt)) :
                 ^
./FaceAverage/faceAverage.py:271:22: F821 undefined name 'xrange'
            for k in xrange(0, 3) :                
                     ^
./FaceSwap/faceSwap.py:74:22: F821 undefined name 'xrange'
            for j in xrange(0, 3):
                     ^
./FaceSwap/faceSwap.py:75:26: F821 undefined name 'xrange'
                for k in xrange(0, len(points)):                    
                         ^
./FaceSwap/faceSwap.py:100:14: F821 undefined name 'xrange'
    for i in xrange(0, 3):
             ^
./FaceSwap/faceSwap.py:153:14: F821 undefined name 'xrange'
    for i in xrange(0, len(hullIndex)):
             ^
./FaceSwap/faceSwap.py:168:14: F821 undefined name 'xrange'
    for i in xrange(0, len(dt)):
             ^
./FaceSwap/faceSwap.py:173:18: F821 undefined name 'xrange'
        for j in xrange(0, 3):
                 ^
./FaceSwap/faceSwap.py:182:14: F821 undefined name 'xrange'
    for i in xrange(0, len(hull2)):
             ^
./ImageMetrics/Python/brisquequality.py:206:34: E999 SyntaxError: invalid syntax
print "Score of the given image: ", qualityscore
                                 ^
./WarpTriangle/warpTriangle.py:21:14: F821 undefined name 'xrange'
    for i in xrange(0, 3):
             ^
./SeamlessCloning/laplacian_pyramid_blending.py:65:10: F821 undefined name 'xrange'
for i in xrange(1,len(combinedLaplacianPyramids)):
         ^
./Homography/virtual-billboard.py:31:69: E999 SyntaxError: invalid syntax
    print 'Click on four corners of a billboard and then press ENTER'
                                                                    ^
./Homography/perspective-correction.py:29:13: E999 SyntaxError: invalid syntax
    print '''
            ^
./FPS/frame_rate.py:19:78: E999 SyntaxError: invalid syntax
        print "Frames per second using video.get(cv2.cv.CV_CAP_PROP_FPS): {0}".format(fps)
                                                                             ^
./FaceMorph/faceMorph.py:47:14: F821 undefined name 'xrange'
    for i in xrange(0, 3):
             ^
./FaceMorph/faceMorph.py:92:14: F821 undefined name 'xrange'
    for i in xrange(0, len(points1)):
             ^
./barcode-QRcodeScanner/barcode-QRcodeScannerPy2.py:57:12: F821 undefined name 'xrange'
		for j in xrange(0,n):
           ^
./Colormap/colormap.py:39:14: F821 undefined name 'xrange'
    for i in xrange(0,4) :
             ^
./Colormap/colormap.py:40:18: F821 undefined name 'xrange'
        for j in xrange(0,3) :
                 ^
13    E999 TabError: inconsistent use of tabs and spaces in indentation
23    F821 undefined name 'xrange'
36
@vikasgupta-github
Copy link
Collaborator

Thanks for pointing it out. Not all code is tested for Python 3. Will fix them soon

@asmorkalov asmorkalov added the bug label Aug 12, 2020
@asmorkalov
Copy link
Collaborator

Addressed in #466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants