'Run python 2 code in python 3 environment

There is a way to run python 2.7 code in python 3 environment without translate the code? Currently on my pc I have installed python 3.8.



Solution 1:[1]

Pyenv let you switch between 2 and 3 python.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 igor Smirnov