Viewing HTML output in browsers

As discussed in the previous section, to be able to see how a browser will display code in a given HTML file, we normally have to open the HTML file from the browser. This process can be very time-consuming (and frustrating) if the file you want to display is buried deep inside a project directory. Let's see how PyCharm streamlines that process in the following steps:

  1. In PyCharm, as you hover your cursor over the top-right corner of the editor, a pop-up toolbar will appear with icons for various browsers:

Opening HTML in browsers
  1. Simply click on the desired browser to have the HTML file displayed. Unlike manually using a browser to open an HTML file offline, PyCharm automatically creates a local server on your machine to host the HTML code (note the URL when the HTML file is opened).
  2. Additionally, it is possible to configure this list of browsers available to use. Go to the PyCharm settings and navigate to Tools | Web Browsers, and you will be taken to this window:

Customizing browsers in PyCharm

From here, you can check/uncheck items in the list displayed to customize the items in the pop-up toolbar, and add in browsers that are not yet included.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.186.6