0004
0004

Reputation: 1260

Python - %paste

I am following a tutorial where the teacher pastes in the html inline with our scrappy shell via: %paste ( the html below)

html_doc = " "
<html>
<head>
<title>Title of hte page </title>
</head>
<body>
<h1>H1 Tag</h1>
<h2> H2 Tag with <a href="#">link</a></h2>
<p> First Paragraph </p>
<p>Second Paragraph </p>
</body>
</html>
" "

but I get this error:

 <html>

  File "<console>", line 1

    <html>


SyntaxError: invalid syntax

I have imported tkinter, and looked up other reasources but cant figure out how to get html inline.

Upvotes: 1

Views: 43

Answers (1)

U13-Forward
U13-Forward

Reputation: 71570

Try doing """:

html_doc = """
<html>
<head>
<title>Title of hte page </title>
</head>
<body>
<h1>H1 Tag</h1>
<h2> H2 Tag with <a href="#">link</a></h2>
<p> First Paragraph </p>
<p>Second Paragraph </p>
</body>
</html>
"""

Upvotes: 1

Related Questions