[英]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.