writing python 2 and 3 code
#1
Hi there,

Im wondering if there is a way to write these lines somehow to be 2 and 3 compatible

        os.makedirs(drive + 'addons', exist_ok=True)     ####################### PYTHON 3 ########################


        if not os.path.exists(drive + addons):   ####################### PYTHON 2 ########################
            os.makedirs(drive + addons)          ####################### PYTHON 2 ########################
Reply
#2
The second example should work fine on python2 and 3
Reply
#3
thank you it worked
Reply

Logout Mark Read Team Forum Stats Members Help
writing python 2 and 3 code0