title: Opening multiple links in default browser as tabs, why do I get multiple windows?
body: <p>I have just made a simple script that opens links from a hand typed list in the default browser. It succeeds at opening the pages, but often opens 2 or three windows with all the pages spread out across. What am I missing?</p>
  
  <pre><code>import webbrowser
  
  new = 2
  
  def open_page(url):
      webbrowser.open(url,new=new)
  
  def file_len(fname):
      with open(fname) as f:
          for i, l in enumerate(f):
              pass
      return i + 1
  
  line_len = file_len('social.txt')
  
  with open('social.txt') as f:
      content1 = f.readlines()
  
  for i in range(line_len):
      url = content1[i].rstrip()
      open_page(url)
      print url
  </code></pre>