Python version compatability - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Python version compatability (/thread-14411.html) |
Python version compatability - saisankalpj - Nov-28-2018 Can we make a python code compatable with python version 2.7 and 3.3.right now my code is in 3.3 RE: Python version compatability - Larz60+ - Nov-28-2018 look at six package: https://pypi.org/project/six/ It can be installed with pip pip install six RE: Python version compatability - ichabod801 - Nov-28-2018 Depending on your code, there may not be much to fix. Often it's just a question of importing division and/or print_function from __future__, and maybe renaming raw_input as input if possible. RE: Python version compatability - saisankalpj - Nov-29-2018 (Nov-28-2018, 07:12 PM)ichabod801 Wrote: Depending on your code, there may not be much to fix. Often it's just a question of importing division and/or print_function from __future__, and maybe renaming raw_input as input if possible. This is fine . But i have queries regarding the following points: 1.in python 3.3 i have used decode(utf-8).will this cause a problem. If so how can i solve it using six library 2.while running my python code in linux env,2.7,i got a error saying “global name windowsError not defined”.the same doesnt happen for 3.3.how do i solve this WindowsError not defined in linux environment - saisankalpj - Nov-29-2018 while running my python code in linux env,2.7,i got a error saying “global name windowsError not defined”.the same doesnt happen for 3.3.how do i solve this RE: Python version compatability - nilamo - Nov-29-2018 You could define your variables before using them. That'd solve the issue. |