an><span class="p">(</span><span class="n">commands</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span>

    <span class="k">try</span><span class="p">:</span>
        <span class="n">output_file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">cmd_str</span><span class="p">)</span>
    <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">