<br><br><div class="gmail_quote">On Mon, Feb 6, 2012 at 1:13 PM, Alan Gauld <span dir="ltr">&lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 06/02/12 15:11, Tony Pelletier wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I&#39;ve been tasked with getting the encoded value using a SOAP call and<br>
then writing the file out.  I first used the interpreter to do so like such:<br>
<br>
import base64<br>
<br>
encoded = &#39;super long encoded string&#39;<br>
data = base64.b64decode(encoded)<br>
outfile = open(&#39;test.xls&#39;, &#39;w&#39;)<br>
</blockquote>
<br>
<br></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Have you tried opening as a binary file?<br>
Excel .xls uses binary data...</blockquote></blockquote><div><br></div><div>Unbelievable.  In the snippet you quoted above, it didn&#39;t matter.  That one always worked, but changing it in the code I wrote, it totally fixed it.  :)</div>
<div><br></div><div>Thanks! </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Alan G<br>
Author of the Learn to Program web site<br>
<a href="http://www.alan-g.me.uk/" target="_blank">http://www.alan-g.me.uk/</a><br>
<br>
______________________________<u></u>_________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/tutor</a><br>
</font></span></blockquote></div><br>