title: How to make print invisible (web creating)?
body: <p>I'm making a movie website for my assignment, but I've been given codes I haven't learnt yet. </p>
  
  <p>I'm using 3 files so I can utilize my learning in class objects.</p>
  
  <p>I have a problem in one of them. (shown below).</p>
  
  <p>I use this code to go through and process all the details (arguments) for the movies I've set up.
  I've set up my arguments <code>=None</code>, because some of my movies I've listed to go through the process has less than the required argument in the function. i.e. in the html file, it causes the text to print 'None'. </p>
  
  <pre><code>import webbrowser
  
  # Uses class method to organise movie contents.
  #INPUT (1)title, (2)description, (3)poster image url, (4)youtube trailer, (5)running time/duration (6)number of season, (7)number of episode, (8)tv station
  #all arguments uses string elements.
  class Movie():
      """This class provides a way to store movie and tv shows related information"""
      def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube, duration_time=None, number_of_seasons=None, tv_station=None):
          self.title = movie_title
          self.storyline = movie_storyline
          self.poster_image_url = poster_image
          self.trailer_youtube_url = trailer_youtube
  #        blank = ' '
  #        if duration_time == True:
  #            return blank
  #        else:
          self.duration = duration_time
          self.seasons = number_of_seasons
          self.station = tv_station
  
      def show_trailer(self):
          """Opens Trailer in webbrowser"""
          webbrowser.open(self.trailer_youtube_url)
  </code></pre>
  
  <p>Here's a screenshot of it - I've highlighted where it print out the text 'None'. 
  <a href="https://i.stack.imgur.com/PC8TD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PC8TD.png" alt="enter image description here"></a></p>
  
  <p>How can I change to text to give a nothing at all instead of having the text 'None'.</p>
  
  <p><strong>html code via python</strong>
  This is in a different file, note.</p>
  
  <pre><code>import webbrowser
  import os
  import re
  print ""
  #ready html tags -&gt;  use following code
  #print("Content-Type: text/HTML")
  
  # Styles and scripting for the page
  main_page_head = '''
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Fresh Tomatoes!&lt;/title&gt;
  
      &lt;!-- Bootstrap 3 --&gt;
      &lt;link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"&gt;
      &lt;link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css"&gt;
      &lt;script src="http://code.jquery.com/jquery-1.10.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;style type="text/css" media="screen"&gt;
          body {
              padding-top: 80px;
              background-color: #eee;
          }
          #trailer .modal-dialog {
              margin-top: 200px;
              width: 640px;
              height: 480px;
          }
          .hanging-close {
              position: absolute;
              top: -12px;
              right: -12px;
              z-index: 9001;
          }
          #trailer-video {
              width: 100%;
              height: 100%;
          }
          .movie-tile {
              margin-bottom: 20px;
              padding-top: 20px;
          }
          .movie-tile:hover {
              background-color: #d1d1d1;
              cursor: pointer;
          }
          .scale-media {
              padding-bottom: 56.25%;
              position: relative;
          }
          .scale-media iframe {
              border: none;
              height: 100%;
              position: absolute;
              width: 100%;
              left: 0;
              top: 0;
              background-color: white;
          }
      &lt;/style&gt;
      &lt;script type="text/javascript" charset="utf-8"&gt;
          // Pause the video when the modal is closed
          $(document).on('click', '.hanging-close, .modal-backdrop, .modal', function (event) {
              // Remove the src so the player itself gets removed, as this is the only
              // reliable way to ensure the video stops playing in IE
              $("#trailer-video-container").empty();
          });
          // Start playing the video whenever the trailer modal is opened
          $(document).on('click', '.movie-tile', function (event) {
              var trailerYouTubeId = $(this).attr('data-trailer-youtube-id')
              var sourceUrl = 'http://www.youtube.com/embed/' + trailerYouTubeId + '?autoplay=1&amp;html5=1';
              $("#trailer-video-container").empty().append($("&lt;iframe&gt;&lt;/iframe&gt;", {
                'id': 'trailer-video',
                'type': 'text-html',
                'src': sourceUrl,
                'frameborder': 0
              }));
          });
          // Animate in the movies when the page loads
          $(document).ready(function () {
            $('.movie-tile').hide().first().show("fast", function showNext() {
              $(this).next("div").show("fast", showNext);
            });
          });
      &lt;/script&gt;
  &lt;/head&gt;
  '''
  
  # The main page layout and title bar
  main_page_content = '''
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;body&gt;
      &lt;!-- Trailer Video Modal --&gt;
      &lt;div class="modal" id="trailer"&gt;
        &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
            &lt;a href="#" class="hanging-close" data-dismiss="modal" aria-hidden="true"&gt;
              &lt;img src=""/&gt;
            &lt;/a&gt;
            &lt;div class="scale-media" id="trailer-video-container"&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;!-- Main Page Content --&gt;
      &lt;div class="container"&gt;
        &lt;div class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt;
          &lt;div class="container"&gt;
            &lt;div class="navbar-header"&gt;
              &lt;a class="navbar-brand"&gt;Find your Favourite Movies&lt;/a&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="container"&gt;
        {movie_tiles}
      &lt;/div&gt;
      &lt;footer style='text-align: center;'&gt;&lt;em&gt;A Udacity project&lt;/em&gt;&lt;/footer&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  '''
  
  # A single movie entry html template
  movie_tile_content = '''
  &lt;div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="{trailer_youtube_id}" data-toggle="modal" data-target="#trailer"&gt;
      &lt;img src="{poster_image_url}" width="220" height="342"&gt;
      &lt;h2&gt;{movie_title}&lt;/h2&gt;
      alt="" title="hover text"&lt;p&gt;{movie_storyline}&lt;p&gt;
      &lt;p&gt;{duration_time} {number_of_seasons}&lt;/p&gt;
      &lt;p&gt;{tv_station}&lt;/p&gt;
  &lt;/div&gt;
  '''
  
  def create_movie_tiles_content(movies):
      # The HTML content for this section of the page
      content = ''
      for movie in movies:
          # Extract the youtube ID from the url
          youtube_id_match = re.search(r'(?&lt;=v=)[^&amp;#]+', movie.trailer_youtube_url)
          youtube_id_match = youtube_id_match or re.search(r'(?&lt;=be/)[^&amp;#]+', movie.trailer_youtube_url)
          trailer_youtube_id = youtube_id_match.group(0) if youtube_id_match else None
  
          # Append the tile for the movie with its content filled in
          content += movie_tile_content.format(
              movie_title=movie.title,
              poster_image_url=movie.poster_image_url,
              trailer_youtube_id=trailer_youtube_id,
              movie_storyline=movie.storyline,
              duration_time=movie.duration,
              number_of_seasons=movie.seasons,
              tv_station=movie.station
          )
      return content
  
  def open_movies_page(movies):
    # Create or overwrite the output file
    output_file = open('fresh_tomatoes.html', 'w')
  
    # Replace the placeholder for the movie tiles with the actual dynamically generated content
    rendered_content = main_page_content.format(movie_tiles=create_movie_tiles_content(movies))
  
    # Output the file
    output_file.write(main_page_head + rendered_content)
    output_file.close()
  
    # open the output file in the browser
    url = os.path.abspath(output_file.name)
    webbrowser.open('file://' + url, new=2) # open in a new tab, if possible
  </code></pre>