Liangent ha scritto:
is it ok to move everything else to another module, and import them after checking python version?
# wikipedia.py import sys if sys.version_info[0] >= 3: print('python 3.x is not supported') sys.exit(1) from wikipedia2 import *
# wikipedia2.py # (everything in wikipedia.py originally)
It doesn't work if scripts that import wikipedia module aren't Python 3 syntax compatible.