title: Is it possible to apply multiple cell formats when writing to a cell with xlsxwriter?
body: <p>I am new to xlsxwriter so any help is appreciated. I am trying to apply multiple cell formats to a cell within xlsxwriter and after looking around I did not see any information showing that this is possible but wanted to ask here and be sure. </p>
  
  <p>Snippet of my code:</p>
  
  <pre><code>wb = xlsxwriter.Workbook('test.xlsx')
  ws1 = wb.add_worksheet()
  calign = wb.add_format()
  calign.set_align('center')
  wrap = wb.add_format()
  wrap.set_text_wrap()
  
  ws1.write(0, 0, 'Username', calign, wrap)
  </code></pre>
  
  <p>It gives me the error: </p>
  
  <pre><code>TypeError: write_string() takes at most 5 arguments (6 given)
  </code></pre>
  
  <p>I understand the error in that I am giving it 1 more argument than it can take. However is there a function in xlsxwriter that is similar to easyXF in xlwt?</p>
  
  <p>Example of easyxf function utilized in writing cell that applies multiple cell formats:</p>
  
  <pre><code>format = xlwt.easyxf('alignment: horiz centre, wrap on')
  ws1.write(0,0,'Text', format)
  </code></pre>
  
  <p>I am utilizing xlsxwriter for the conditional formatting feature so switching to xlwt is not an option unless the cell formats become more important than the conditional formatting.</p>
  
  <p>Thanks.</p>