티스토리 뷰

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

출처 : https://zetawiki.com/wiki/Python_%EC%86%8C%EC%8A%A4%EC%BD%94%EB%93%9C_%EB%B2%84%EC%A0%84_%EB%B3%80%ED%99%98_2to3.py

댓글
댓글쓰기 폼
Total
43,580
Today
3
Yesterday
28
«   2019/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30