if python 3.x is running, the script will exit before import is executed.
so there will be no problem about syntax.
On 5/9/09, Francesco Cosoleto <cosoleto(a)gmail.com> wrote:
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.
--
Francesco Cosoleto
«Non dee l'uomo, per maggiore amico, dimenticare li servigi ricevuti dal
minore». (Dante Alighieri, Convivio, II, 65)
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l