Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 2to3 not changing files

I have a bunch of modules written in python 2.x and I need them to be in 3.x for them to work. I ran 2to3 on the entire folder, and it seemed to work fine, but when I looked at the files again they were the same. I have not used 2to3 and was wondering if it saves the converted files in some other directory.

like image 403
carloabelli Avatar asked Jan 15 '13 17:01

carloabelli


1 Answers

You need to tell 2to3 explicitly to actually write the changes, using the -w switch:

2to3 -w example.py
like image 96
Martijn Pieters Avatar answered Oct 01 '22 17:10

Martijn Pieters