<div>Let me clarify. This prints out "all sorts of crap", which means an image string, the image as a string, to the screen:</div>
<div> </div>
<div>print 'Content-type: image/jpeg'<br>print 'Content-Encoding: base64'<br>print<br>print pic().encode('base64')<br>print '</body></html>'<br> <br>The following once upon a time printed images, but now it doesn't. Why would that be? I would refresh the screen, and it would print. I'd change a line and it wouldn't. I'd change it back to what it was and it would no longer the image to the screen. Why is that? The same happens with or without the base64 stuff. Commenting out a line seemed to make a difference!</div>
<div> <br>print 'Content-type: text/plain'<br>#print 'Content-type: image/jpeg'<br>print<br>print pic()<br>print '</body></html>'<br><br>The above prints out a broken image of correct dimensions.</div>
<div> </div>
<div>Of course I try and figure out how things work once they get working. Sometimes, however, there is __no__ logic to it __at__all__. Sorry. After years of struggling with python I've come to realize that even though I may not be a good programmer, it isn't me. It may not be python itself. It may be the crappy hardware the server farms use. It may be the way they tweak their python interpreter. But it isn't just me. </div>
<div> </div>
<div>It would be nice if I could get this code printing images to the screen as it was before I had to put out another unnecessary fire when code that previously uploaded the images in the first place inexplicably no longer worked. Then, lo and behold, when I came back to this code that I hadn't touched and was working fine earlier this week, it no longer works. Lovely. My "plug-and-play" program has devoured two weeks of my time and I'm still up the creek without a paddle. Sure would appreciate any help you can give.</div>
<div>V</div>
<div> </div>
<div class="gmail_quote">On Fri, Oct 16, 2009 at 8:54 PM, Carsten Haese <span dir="ltr"><<a href="mailto:carsten.haese@gmail.com">carsten.haese@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">Victor Subervi wrote:<br>> I'm sorry. These scripts worked fine before and should have been<br>> plug-and-play. I have wasted 2 frustrating weeks trying to figure out<br>> why they don't work only to discover things that make no sense at all<br>
> that do the trick. I thought programming was straight-forward and<br>> "logical"...boy, am I disappointed. Sorry for the jade.<br><br></div>Clearly, you're not jaded enough. When my code does things that I don't<br>
understand, I try to understand what's going on. Your approach seems to<br>be to randomly mutate your code until it works. There is nothing<br>inherently wrong with that as long as you then try to understand *why*<br>
it works once you get it work. You seem to have omitted this step. Since<br>you never understood why your code worked, consequently now you don't<br>understand why your code has stopped working.<br>
<div class="im"><br>> What I mean is that the code supplied merely posts a broken image, with<br>> the correct dimensions, interestingly enough. It makes no difference at<br>> all if one adds the line "print '</body></html>'" or not. I also believe<br>
> (and hope) my initial post is pretty clear.<br><br></div>Actually, your original post was not clear at all. Your original post<br>said "This will print all sorts of crap to the screen." This is not<br>useful at all. The only reason why I responded at all was because I<br>
noticed the </body></html> line in your code that clearly didn't have<br>any business being there. The fact that you even considered the<br>possibility that that line could help shows just how little you know<br>
about what's going on in your code.<br><br>By the way, you now have changed your story from "random crap" to "a<br>broken image". Which one is it?<br><br>The only way we have a fighting chance to help you in figuring out<br>
what's going in is if you post the *exact* code you're running (and by<br>that I mean the actual code that you know your server is executing, and<br>not just some code that somewhat resembles the code that the server<br>
might be executing), a detailed description of the result you're<br>expecting, and a detailed description of the result you're getting instead.<br>
<div>
<div></div>
<div class="h5"><br>--<br>Carsten Haese<br><a href="http://informixdb.sourceforge.net/" target="_blank">http://informixdb.sourceforge.net</a><br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>