I want to make some common code of mine working through python2.7 and also python3.6 versions.
In syntax manner it simply implies the following: converting prints to console of types: print "hello" to print("hello") which is acceptable in both versions.
The problem occurs only in one module import for Queue module.
In Python2.7: from Queue import Queue
In Python3.6: from queue import Queue
Trying to do something in the import section like:
try:
from Queue import Queue
except ImportError:
from queue import Queue
Will work but its really not elegant and ugly, any ideas for making it more reasonable?
sixwill help