title: Python list(?) sending incorrect number of values to other program
body: <p>I have been trying to upload close to a thousand SVG files to a particular program (FontForge) and as such searched for a way to automate it. Unfortunately I am really unfamiliar with Python, to the extent that I'm not sure if what I changed about the code ended up changing something fundamental.</p>
  <p>The original code you were meant to individually continue the table that the original coder left with the file name and glyph names of the SVG files. This would require doing it manually, as I realized quickly it wouldn't allow loops within the brackets itself. The original code was as follows, albeit with more items:</p>
  <pre><code>select = [
         ('null',             'null'),
         ('bs-info-circle',   'infoCircle'),
  ]
  </code></pre>
  <p>Looking at it, and with a lot of googling and experimentation, I guessed that it was a list of tuples. As such, I created various loops adding onto a toSelect list that I created. Since they are rougly the same I'll just show one here:</p>
  <pre><code>for x in svc:
      icon=&quot;svc-&quot;+x+&quot;con_lang&quot;
      glyph=x
      #print((icon, glyph))
      toSelect.extend(((icon, glyph),)) #comma necessary to force it to add in a pair, rather than individually
  </code></pre>
  <p>The variable svc is a list of strings: <code>['ba', 'be', 'bi', 'bo'...]</code> pulled from a TXT file. The variable toSelect, when printed, looks as follows:</p>
  <pre><code>[('svc-bacon_lang', 'ba'), ('svc-becon_lang', 'be'), ('svc-bicon_lang', 'bi'), ...]
  </code></pre>
  <p>Long story short, I now have a list that seems to be formatted the same as the contents of the original code. As such, I set it equal in a simple manner:</p>
  <pre><code>select = toSelect
  </code></pre>
  <p>However, running the build program that pulls from this code is giving the following error message:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\*****\Downloads\ff-batch-main\ff-batch-main\build.py&quot;, line 392, in &lt;module&gt;
      run_fontforge(config)
    File &quot;C:\Users\*****\Downloads\ff-batch-main\ff-batch-main\build.py&quot;, line 148, in run_fontforge
      for key, name in config.select:
  ValueError: not enough values to unpack (expected 2, got 1)
  </code></pre>
  <p>I have tried every variation of declaring select that I can, including a few that cause the following error message:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\*****\Downloads\ff-batch-main\ff-batch-main\build.py&quot;, line 392, in &lt;module&gt;
      run_fontforge(config)
    File &quot;C:\Users\*****\Downloads\ff-batch-main\ff-batch-main\build.py&quot;, line 148, in run_fontforge
      for key, name in config.select:
  ValueError: too many values to unpack (expected 2)
  </code></pre>
  <p>Printing the value of select[0] does seem to tell me that that error is caused by all of the entries being considered one entry on the list? So at least I know that.</p>
  <p>Still, I can't figure out why it doesn't take my original attempt, as select[0] = ('null', 'null'). I'm worried that select isn't supposed to be a list at all, but is something different that I'm simply unfamiliar with since I do not know python. Is this some sort of function that I broke by adding items sequentially instead of all at once?</p>
  <p>I will also show the code from the 'build' program that is flagged as the problem. The only thing that I edited was the 'config' program, as instructed by the coder, but hopefully this at least will give context?</p>
  <pre><code>def run_fontforge(config):
      from icon_map import maps
      try:
          from select_cache import maps as icons
      except:
          icons = {}
      print(f&quot;Generating fonts =&gt; {config.build_dir}/{config.font_name}.ttf&quot;)
      with open('select_cache.py', 'w') as f:
          f.write(&quot;# SVG to Font Icon mapping\n&quot;)
          f.write(f&quot;# Generated: {datetime.now()}\n&quot;)
          f.write(&quot;maps = {\n&quot;)
  
          last = config.font_start_code - 1
          for _,m in icons.items():
              last = max(last, m['code'])
          last += 1
  
          for key, name in config.select:
              icon = icons.get(key)
              src = maps.get(key)
  </code></pre>
  <p>So yeah. Um, any advice or explanations would be greatly appreciated, and I'll do my best to give additional information when possible? Unfortunately I started trying to understand Python yesterday and am coming at this from a rusty knowledge of java so I am not really fluent, might not know terms and whatnot. I just wanted to import some files man...</p>