<p><br>
Here're slides from a presentation about writing code that runs on 2.x and 3.x: <a href="http://stromberg.dnsalias.org/~dstromberg/Intro-to-Python/">http://stromberg.dnsalias.org/~dstromberg/Intro-to-Python/</a></p>
<p>And in case you still want a preprocessor for Python (you likely don't need one this time), here's an example of doing this using the venerable m4: <a href="https://pypi.python.org/pypi/red-black-tree-mod">https://pypi.python.org/pypi/red-black-tree-mod</a> . Note the many comments added to keep line numbers consistent. </p>
<p>Sent from my android phone.</p>
<div class="gmail_quote">On May 28, 2013 12:47 PM, "Carlos Nepomuceno" <<a href="mailto:carlosnepomuceno@outlook.com">carlosnepomuceno@outlook.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are there Python 'preprocessor directives'?<br>
<br>
I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a single file.<br>
<br>
Is that possible? How?<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</blockquote></div>