Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (4k points)

I have a large ML project in python 2 code and I just started using PyCharm as an IDE. I'm currently using WinPython 3.4 and I'd preferably like to do everything in python 3 instead of continue using legacy 2. When I cloned the project from git a popup in pycharm came up that was something along the lines of converting the code to 3 from 2 but I didn`t really think about it and exited it. How do I convert it?

1 Answer

0 votes
by (8.7k points)

With the help of the 2to3 tool, we start the conversion from version 2 to version 3.

  • Click  on the terminal in the status bar->now you are in shell command in the root of your project->In this type the command to convert(mydemo.py)

2to3 mydemo.py -w

  •  If you want to convert all file from the folder then type the below command:

2to3. -w

 Interested in python, check out the Python course with guided projects and 24X7 support by Intellipaat.

Related questions

0 votes
1 answer
0 votes
0 answers
asked Jan 5, 2021 in Python by spec300 (120 points)
0 votes
5 answers
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...