This is quote from an DeathByCaptcha API documentation I am using.
dict deathbycaptcha.Client.decode(file imageFile, int timeout)
dict deathbycaptcha.Client.decode(str imageFileName, int timeout)
It can either accept path to image file or the file object
I have this line of code.
client.decode(urllib.urlopen('https://example/image.jpg').read(), 30)
But its giving me error because .read()
does returns file-like
object.
My preference is to do it in one line.
Is there any way I can easily cast that stream read by read()
to file-like object?
If not possible in one line like we do in PHP (string) 100
then I will accept a multi-line