Hi,<br><br>You could try the C preprocessor.  Personally, I&#39;d just go for python&#39;s inbult logging framework, and worry about the performance issue later. <br><br>Regards<br><br><br><br><div class="gmail_quote">On Mon, Jun 8, 2009 at 1:07 AM, Vishal <span dir="ltr">&lt;<a href="mailto:vsapre80@gmail.com" target="_blank">vsapre80@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<div><br></div><div>We would like to have debug and release versions of our scripts. However since the scripts are directly used by the &#39;users&#39; and they are not real software guys...maintaining two different scripts and then keeping them synchronized across 15-20 workstations etc is not something that the management wants.</div>


<div>Scripts are complex enough that we cannot abstract out all the variables into config files....which might have been easier for users (just change parameters in a config file)</div><div><br></div><div><b>Is there a way to create a conditionally compilable Python script ?</b> Some facility that would prevent from code getting compiled into &quot;.pyc&quot;....something like the old #ifdef #endif preprocessor directives....is there a Python preprocessory available :)</div>


<div><br></div><div>if thats doable I can ask them to make all experimental modifications within the conditional directives. I could still ask them to do that using simple if&#39;s and bool parameters, however, putting too many ifs might degrade the performance of these scripts. (&quot;the lesser the branches the better it is for processor performance...more so for super scalar processors&quot;)</div>


<div><br></div><div>We cannot use the, often unknown, __debug__ flag, because our users would like to simply double-click on a python file, which means to use the -O or -OO options (which sets __debug__ to False) we&#39;d have to make windows python command line have these, and then double clicking would be of no use if you want the run stuff inside the __debug__.</div>


<div><br></div><div>Any and every help is most welcome :) <br><br></div><div>Thanks and best regards,</div><div>Vishal Sapre<br><br><div class="gmail_quote">On Wed, May 27, 2009 at 1:25 PM, Sam&#39;s Lists <span dir="ltr">&lt;<a href="mailto:samslists@gmail.com" target="_blank">samslists@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Anand---<br><br>Thanks, that worked great.<br><font color="#888888"><br>-Sam</font><div><div>

</div><div><br>
<br><div class="gmail_quote">On Tue, May 26, 2009 at 7:34 PM, Anand Chitipothu <span dir="ltr">&lt;<a href="mailto:anandology@gmail.com" target="_blank">anandology@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>&gt; text = &quot;The Price £7&quot;<br>
&gt; pattern = u&quot;£\d&quot;<br>
&gt;<br>
&gt; m = re.search(pattern, text, re.UNICODE)<br>
&gt; print m.group(0)<br>
<br>
</div>Your text is in utf-8 encoding and pattern in unicode.<br>
Make text unicode solves the issue.<br>
<br>
text = u&quot;The Price £7&quot;<br>
<div>pattern = u&quot;£\d&quot;<br>
m = re.search(pattern, text, re.UNICODE)<br>
</div>print m.group(0).encode(&#39;utf-8&#39;)<br>
<br>
Anand<br>
_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org" target="_blank">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
</blockquote></div><br>
</div></div><br>_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org" target="_blank">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Thanks and best regards,<br>Vishal Sapre<br><br>---<br><br>&quot;So say...Day by day, in every way, I am getting better, better and better !!!&quot;<br>&quot;A Strong and Positive attitude creates more miracles than anything else. Because...Life is 10% how you make it, and 90% how you take it&quot;<br>


&quot;Diamond is another piece of coal that did well under pressure”<br>&quot;Happiness keeps u Sweet, Trials keep u Strong, <br>Sorrow keeps u Human, Failure Keeps u Humble, <br>Success keeps u Glowing, But only God Keeps u Going.....Keep Going.....&quot;<br>



</div>
<br>_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org" target="_blank">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>I am but a man.<br>