חיפוש בתמיכה

יש להימנע מהונאות תמיכה. לעולם לא נבקש ממך להתקשר או לשלוח הודעת טקסט למספר טלפון או לשתף מידע אישי. נא לדווח על כל פעילות חשודה באמצעות באפשרות ״דיווח על שימוש לרעה״.

מידע נוסף

how to show python code as text

more options

Some docs pages show python source code, e.g. http://matplotlib.org/pyplots/pyplot_simple.py. I would like to see the code as a text file in Firefox, but am only given the option to download the file. How can I change this?

Some docs pages show python source code, e.g. http://matplotlib.org/pyplots/pyplot_simple.py. I would like to see the code as a text file in Firefox, but am only given the option to download the file. How can I change this?

כל התגובות (1)

more options

The problem is that the server is sending a content type of "application/octet-stream" with the file, which generically identifies binary content that Firefox cannot display. (See screenshot.)

As a workaround, you can prepend the URL with view-source: to show the file contents in a tab. One less-than-convenient way is:

  • Ctrl+click or right-click the link to direct it to a new tab
  • Cancel the download dialog
  • Type or paste view-source: at the beginning of the URL and press Enter to load it