Add code examples
We need a side by side code example using the twitter bootstrap mechanisms for code viewing that shows Python 2 versus Python 3 code (and how little changes are needed) on the site.
How about using 2to3 convert the code and test which will help 2to3 to reach accuracy in conversion?
That doesn't make a lot of sense - the point is to show the difference between the two, or at least highlight 3 - not to test 2to3, since it is mostly accurate.
On Wednesday, December 14, 2011 at 10:36 AM, kracekumar wrote:
How about using 2to3 convert the code and test which will help 2to3 to reach accuracy in conversion?
Reply to this email directly or view it on GitHub: https://github.com/jnoller/getpython3.com/issues/14#issuecomment-3141143
Fine. Then generating code from 2to3 will make sense and if it is feasible to run 2to3 as background process to do it. For simplicity we can add py3 code directly.
Idea For implementing: 1.add pretty.css 2.add pretty.js and body onload call prettyPrint().
Let user enter or author enter the code as follow:
<code> print("python 3 welcomes you") </code>
To highlight keywords we need to link to google's prettyprint and code should be replaced as
<pre class="prettyprint"> #actual python code </pre>
else embed pyt3 & py2 directly inside the tag
<pre class="prettyprint"> </pre>
that is an interesting idea - a live 2to3 translation - open a new ticket - that's beyond the capabilities of the site right now, but a good idea!
On Wednesday, December 14, 2011 at 10:58 AM, kracekumar wrote:
Fine. Then generating code from 2to3 will make sense and if it is feasible to run 2to3 as background process to do it. For simplicity we can add py3 code directly.
Idea For implementing: 1.add pretty.css 2.add pretty.js and body onload call prettyPrint().
Let user enter or author enter the code as follow:
print("python 3 welcomes you")To highlight keywords we need to link to google's prettyprint and code should be replaced as
#actual python codeelse embed pyt3 & py2 directly inside the tag
Reply to this email directly or view it on GitHub: https://github.com/jnoller/getpython3.com/issues/14#issuecomment-3141901
Sure.