History of AFNI updates  

|
July 11, 2017 10:09PM
Dear AFNI team,

Recently, I realize that using AFNI by writing ipython script (*.ipy) is highly enjoyable compared with tcsh or bash scripts,
except for the Python 2/3 compatibility issue.

Although Python 2 and 3 have been running in parallel for a long time, but currently I feel the migrating speed toward Python 3 is accelerating.
For example,
1) Python 2.7 stops to get feature back port.
2) Most popular packages have already been 2/3 compatible.
3) Some major packages (e.g., IPython) start to maintain Python 3 only code base.
I personally find Python 3 quite convenient to work with, given the accumulating new language features.
So I have Python 3 installed on my computer as the default Python interpreter.

Unfortunately, the Python-related code in AFNI only works with Python 2.
In order to use AFNI smoothly, I have to switch to Python 2 manually each time.
In fact, it is usually quit easy to refactor the code to make it compatible with both Python 2 and 3.
For example, one prominent issue that currently prevents the scripts from running with Python 3 is the ubiquitous
print "some message"
To be 2/3 compatible, simply change it into
print("some message")
For more involved cases, there is a single file package called "six" which provides a compatibility layer.
There is also tools to automate such translations.

Will you consider refactoring the python code to also support Python 3?
It will be truly appreciated and I will also be happy if there is anything I can help~

Thanks,
Subject Author Posted

Make AFNI compatible with both Python 2 and 3

herrlich10 July 11, 2017 10:09PM

Re: Make AFNI compatible with both Python 2 and 3

Daniel Glen July 12, 2017 12:26PM

Re: Make AFNI compatible with both Python 2 and 3

herrlich10 July 13, 2017 02:50AM

Re: Make AFNI compatible with both Python 2 and 3

celstark October 02, 2017 11:59AM

Re: Make AFNI compatible with both Python 2 and 3

bbfrederick July 13, 2018 11:10AM

Re: Make AFNI compatible with both Python 2 and 3

Daniel Glen July 13, 2018 12:22PM

Re: Make AFNI compatible with both Python 2 and 3

ptaylor July 13, 2018 12:58PM

Re: Make AFNI compatible with both Python 2 and 3

Daniel Glen July 13, 2018 02:29PM