Python Forum
What is wrong with my format?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is wrong with my format?
#1
Script,
import requests


url = 'https://github.com/masker112/Quick-Reply-app/blob/Stuff/Quick%20Reply.jpg?raw=true'
r = requests.get(url, allow_redirects=True)

open('ok.jpg', 'wb').write(r.content)
Output:
[Finished in 0.993s]
Error:
ok.jpg It looks like we don't support this format.
Sry but the img tags didn't work!
Reply
#2
Post the error on the forum inside "[error]" tags, not as an image please.
Oshadha likes this post
Reply
#3
Python's error traceback is usually much more verbose. Please post the whole content of the error traceback.
Reply
#4
this doesn't look like error, but like some response from an API. But the link returns 404. Not sure what you actually try to do here
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
What i tried to do here is,
Upload a .jpg file to github
Download it using Python,
And save it as ok.jpg.

404 Page error is because it is private!
If I make it public, will it work?
Reply
#6
You could perhaps access Github through its API. Modules such as PyGithub give you ways of interacting with Github. For example you can login and download files through this API (see the examples section).
Oshadha likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,553 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  Saves the data in the wrong format Hennie 1 2,124 Jan-01-2020, 03:40 PM
Last Post: sandeep_ganga
  python gives wrong string length and wrong character thienson30 2 3,000 Oct-15-2019, 08:54 PM
Last Post: Gribouillis
  Wrong or missing date format and time in mails sipriusPT 3 4,266 Aug-08-2017, 03:22 PM
Last Post: sipriusPT

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020