C:\Python34\Tools\Scripts\2to3.py
- 소스파일이 3버전에 맞게 변환되고, 원본은 "파일명.bak"으로 보존된다.
python C:\Python34\Tools\Scripts\2to3.py -w 소스파일명
- 실행예시
D:\workspace\python>python C:\Python34\Tools\Scripts\2to3.py -w greeting.py
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored greeting.py
--- greeting.py (original)
+++ greeting.py (refactored)
@@ -1 +1 @@
-print 'hello'
+print('hello')
RefactoringTool: Files that were modified:
RefactoringTool: greeting.py