[英]How to call 2to3 in Python?
有沒有一種方法可以通過在 python 中調用2to3
將 python2 字符串轉換為 python3 字符串,而無需通過命令行調用它?
input = 'a=raw_input()'
output = 'a=input()'
2to3
是開源的:
https://github.com/python/cpython/tree/3.10/Lib/lib2to3/
refactor_string
function 就是您要查找的內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.