I tried to make url of short length but its giving unexpected indent.i provided the piece of code on which its giving error
trackback:
Traceback (most recent call last): File "C:\Users\HOME\Desktop\movie trailer\entertainment.py", line 1, in import media File "C:\Users\HOME\Desktop\movie trailer\media.py", line 85 "/w185"+str(detail_new[4])" ^ IndentationError: unexpected indent
self.poster_image_url = "http://image.tmdb.org/t/p"
"/w185"+str(detail_new[4])"
self.trailer_youtube_url =
"https://www.youtube.com/watch?"
"v="+str(self.get_trailer_link(movie_name))"
You should use "\" to indicate to Python that the line does not terminate:
my_variable = "beginning of the string" \
"end of the string"
For your second case:
my_variable = \
"beginning of the string" \
"end of the string"
You can also use parentheses for the same purpose:
my_variable = (
"beginning of the string"
"end of the string"
)
For your specific case:
self.poster_image_url = (
'http://image.tmdb.org/t/p'
'/w185' + str(detail_new[4])
)
self.trailer_youtube_url = (
'https://www.youtube.com/watch?'
'v=' + str(self.get_trailer_link(movie_name))
)