How to detect if code is python 3 compatible

后端 未结 5 979
没有蜡笔的小新
没有蜡笔的小新 2021-02-01 16:55

I\'m doing static code analysis using openstack/bandit. Do have a lot of repositories, some of those are in python 2 other in python 3. How can I detect if code is syntactically

5条回答
  •  遥遥无期
    2021-02-01 17:46

    You can use Pycharm IDE for this. Just open the python files in the pycharm editor, it will show warnings if the code is not compatible to Python2 or Python3.

    Here is the screenshot where it shows print command syntax warning.

提交回复
热议问题