Skip to content

Commit

Permalink
Merge pull request #355 from WMSaj13/master
Browse files Browse the repository at this point in the history
One-liner changed to python3
  • Loading branch information
lakshmanok authored Jan 11, 2019
2 parents d1f7040 + ce75f0b commit 63b2ec3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"gsutil cp $IMAGE_URL flower.jpg\n",
"\n",
"# Base64 encode and create request message in json format.\n",
"python -c 'import base64, sys, json; img = base64.b64encode(open(\"flower.jpg\", \"rb\").read()); print json.dumps({\"image_bytes\":{\"b64\": img}})' &> request.json"
"python -c 'import base64, sys, json; img = base64.b64encode(open(\"flower.jpg\", \"rb\").read()).decode(); print(json.dumps({\"image_bytes\":{\"b64\": img}}))' &> request.json"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
"gsutil cp $IMAGE_URL flower.jpg\n",
"\n",
"# Base64 encode and create request message in json format.\n",
"python -c 'import base64, sys, json; img = base64.b64encode(open(\"flower.jpg\", \"rb\").read()); print json.dumps({\"image_bytes\":{\"b64\": img}})' &> request.json"
"python -c 'import base64, sys, json; img = base64.b64encode(open(\"flower.jpg\", \"rb\").read()).decode(); print(json.dumps({\"image_bytes\":{\"b64\": img}}))' &> request.json"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"gsutil cp $IMAGE_URL flower.jpg\n",
"\n",
"# Base64 encode and create request message in json format.\n",
"python -c 'import base64, sys, json; img = base64.b64encode(open(\"flower.jpg\", \"rb\").read()); print json.dumps({\"image_bytes\":{\"b64\": img}})' &> request.json"
"python -c 'import base64, sys, json; img = base64.b64encode(open(\"flower.jpg\", \"rb\").read()).decode(); print(json.dumps({\"image_bytes\":{\"b64\": img}}))' &> request.json"
]
},
{
Expand Down

0 comments on commit 63b2ec3

Please sign in to comment.