From 72e9d839ed402f6938fa93ac64c3065ec9e71047 Mon Sep 17 00:00:00 2001 From: Joise S Arakkal <110761281+joise-s-arakkal@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:27:37 +0530 Subject: [PATCH] Update search.py Add Brackets in print statements --- python/search.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python/search.py b/python/search.py index ccb17729..408b5495 100644 --- a/python/search.py +++ b/python/search.py @@ -17,6 +17,7 @@ # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. + DEVELOPER_KEY = 'REPLACE_ME' YOUTUBE_API_SERVICE_NAME = 'youtube' YOUTUBE_API_VERSION = 'v3' @@ -50,9 +51,10 @@ def youtube_search(options): playlists.append('%s (%s)' % (search_result['snippet']['title'], search_result['id']['playlistId'])) - print 'Videos:\n', '\n'.join(videos), '\n' - print 'Channels:\n', '\n'.join(channels), '\n' - print 'Playlists:\n', '\n'.join(playlists), '\n' + print('Videos:\n', '\n'.join(videos), '\n') + print('Channels:\n', '\n'.join(channels), '\n') + print('Playlists:\n', '\n'.join(playlists), '\n') + print() if __name__ == '__main__': @@ -63,5 +65,5 @@ def youtube_search(options): try: youtube_search(args) - except HttpError, e: - print 'An HTTP error %d occurred:\n%s' % (e.resp.status, e.content) + except HttpError as e: + print('An HTTP error %d occurred:\n%s' % (e.resp.status, e.content))