<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1034297" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1034297</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/how-does-one-debug-cgi-more-efficiently#comment-1199265</link>
    <description> &lt;p&gt;See here for some ideas:&lt;br /&gt;
 &lt;a href=&quot;http://www.python.net/crew/davem/cgifaq/faqw.cgi?req=show&amp;amp;file=faq01.002.htp&quot; class=&quot;bb-url&quot;&gt;Python CGI FAQ: How do I debug my scripts?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://docs.python.org/lib/node478.html&quot; class=&quot;bb-url&quot;&gt;CGI traceback in Python&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.python.org/doc/essays/ppt/sd99east/sld047.htm&quot; class=&quot;bb-url&quot;&gt;Guido&#039;s basic debugging framework for CGI&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you write the scripts with not-unreasonable abstraction and modularity, you could run them - or parts of them - with the Python interpreter in the shell or through your IDE.  This will print thrown errors and tracebacks.  You could use the &lt;a href=&quot;http://www.ferg.org/papers/debugging_in_python.html&quot; class=&quot;bb-url&quot;&gt;Python debugger&lt;/a&gt; as well.  For most of any CGI script, this must be possible, with simulated inputs and flow.&lt;/p&gt;
&lt;p&gt;As a last resort, especially when you need to debug simple errors with HTTP inputs, you could use the techniques Greg described.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 09 May 2006 10:24:06 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1199265 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/webmasters-corner/how-does-one-debug-cgi-more-efficiently#comment-1199152</link>
    <description> &lt;p&gt;I&#039;m not sure what all python has available, however as a general way to help figure things out, you can always output certain data to either the screen, or better, to a text file. Then you can follow the flow. Make sure to have each output indicate what line # it is, so you can find it easier. Then if a calculation goes wrong, you can see where the numbers went off. Or a more common thing, if an SQL statement isn&#039;t executing right, have the actual sql statement outputed so you can se exactly how it was formatted. (this really helps when things are like forgeting to quote something that should have quoptes and such)&lt;/p&gt;
&lt;p&gt;I have a custom PHP debug script I use, the nice thing is php has the __FILE__ and __LINE__ variables to indicate current filename and line number that is being executed. I have functions that will output a whole array, etc. &lt;/p&gt;
&lt;p&gt;If you do use something like this, I recommend you set a variable at the begining of the program to TRUE, (ie. in PHP I used &lt;strong&gt;$debugging = true;&lt;/strong&gt;) then all output lines start the same (&lt;strong&gt;if ($debugging) debugout(__FILE__,__LINE__,&quot;var1 = $var1&quot;);&lt;/strong&gt;) so that on the final production copy, you can easiuly search to remove all of these lines.&lt;/p&gt;
&lt;p&gt;It&#039;s the tired and true debugging, but if you have nothing else, it is beter than a 500 error and trial/error approach.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Sun, 07 May 2006 23:10:47 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1199152 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
