title: How do I add a row of dashes between the first two print lines in Python?
body: <p>I'm trying to create a table in the console from a csv file. To make the output look more like a table, I want to add a row of dashes on the second line to split the headings and the main table content.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>import csv
  
  with open('filename.csv', mode='r') as csv_file:
      csv_reader = csv.reader(csv_file)
      line_count = 0
      for row in csv_reader:
          if line_count == 0:
              print("|",row[0]," "*(20-len(row[0])), "|",
                row[1], " " * (15 - len(row[1])), "|",
                row[2], " " * (20 - len(row[2])), "|",
                row[3], " " * (5 - len(row[3])), "|")
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>| Track           | Artist           | Album                 | Time   |
  | Songname 1      | Artist 1         | Album 1               | 7:15   |
  | Songname 1      | Artist 2         | Album 2               | 6:27   |
  | Songname 1      | Artist 3         | Album 3               | 5:24   |
  | Songname 1      | Artist 4         | Album 4               | 2:50   |
  | Songname 1      | Artist 5         | Album 5               | 4:39   |
  | Songname 1      | Artist 6         | Album 6               | 5:11   |
  | Songname 1      | Artist 7         | Album 7               | 2:56   |
  | Songname 1      | Artist 8         | Album 8               | 4:29   |
  | Songname 1      | Artist 9         | Album 9               | 3:17   |
  | Songname 1      | Artist 10        | Album 10              | 3:04   |
  
  Process finished with exit code 0
  </code></pre>
  
  <p>And this is the output I'd like to achieve:</p>
  
  <pre><code>-----------------------------------------------------------------------
  | Track           | Artist           | Album                 | Time   |
  -----------------------------------------------------------------------
  | Songname 1      | Artist 1         | Album 1               | 7:15   |
  | Songname 1      | Artist 2         | Album 2               | 6:27   |
  | Songname 1      | Artist 3         | Album 3               | 5:24   |
  | Songname 1      | Artist 4         | Album 4               | 2:50   |
  | Songname 1      | Artist 5         | Album 5               | 4:39   |
  | Songname 1      | Artist 6         | Album 6               | 5:11   |
  | Songname 1      | Artist 7         | Album 7               | 2:56   |
  | Songname 1      | Artist 8         | Album 8               | 4:29   |
  | Songname 1      | Artist 9         | Album 9               | 3:17   |
  | Songname 1      | Artist 10        | Album 10              | 3:04   |
  -----------------------------------------------------------------------
  </code></pre>