title: Displaying python output to website
body: <p>I can print my output in Powershell but I want the text to be displayed on the website, not on the Powershell.</p>
  
  <p>Here is my index.html :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Fluxus Generator&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body bgColor="peachpuff"&gt;
    &lt;center&gt;&lt;h1&gt;Fluxus Generator&lt;/h1&gt;&lt;center&gt;
  
      &lt;center&gt;&lt;img src="card.png" alt="Card" /&gt;&lt;/center&gt;
      &lt;font face= "Calibri" size="7" color = "purple"&gt;
  
    &lt;center&gt;&lt;p&gt;&lt;a href="/"&gt;Another Card&lt;/a&gt;&lt;/p&gt;&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and here is app.py: (I united app.py with main.py since separately didn't work)</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  import random
  
  from flask import Flask
  from flask import render_template
  
  app = Flask(__name__)
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  def generate_word():
      """Generate a list of words and shuffle them"""
      words = list()
  
      req = requests.get('https://en.wikipedia.org/wiki/List_of_plain_English_words_and_phrases')
      html_source = req.text
      soup = BeautifulSoup(html_source, "html.parser")
  
      for source in soup.find_all('a', { "class" : "extiw" }):
          word = source.find(text = True)
          try:
              word = str(word)
              words.append(word)
          except:
              pass
  
      random.shuffle(words)
      return words
  
  
  def generate_instruction(words):
      """Build an instruction from the word lists"""
      instruction_struct = [
          'I', words[0], words[1], words[8], 'the',
          words[2], words[5], 'with',
          words[4], words[7]
      ]
  
      instruction = ' '.join(instruction_struct)
      print instruction
  
  
  words = generate_word()
  generate_instruction(words)
  
  if __name__ == '__main__':
      app.run()
  </code></pre>
  
  <p>I've tried cgi, web but didn't work out.
  How should I change the code so I get the text on my website?
  Should I add to index.html?</p>