📜  将 python 2 转换为 3 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:02.356000             🧑  作者: Mango

代码示例1
# Example Python 2 code
def greet(name):
    print "Hello, {0}!".format(name)
print "What's your name?"
name = raw_input()
greet(name)

# Invoke 2to3 on the command line.
2to3 example.py

# Docs for the module available at https://docs.python.org/3/library/2to3.html#module-lib2to3