我正在阅读一个python文件,其中作者使用'‘而不是()来调用print语句,例如:
print 'Install the following library to make this script work'
print 'Impacket : https://github.com/CoreSecurity/impacket.git'
print 'PyCrypto : https://pypi.python.org/pypi/pycrypto'这些是前面提到的代码的一些行。
我的问题是,这个使用打印的表单是否正确,或者我遗漏了什么。
发布于 2021-04-02 08:10:49
这就是Python2。Python3中最明显的突破性变化是使print成为一个合适的函数。Python 2已弃用;您现在应该只使用Python 3,因此应该强制编写
print('Install the following library to make this script work')
print('Impacket : https://github.com/CoreSecurity/impacket.git')
print('PyCrypto : https://pypi.python.org/pypi/pycrypto')发布于 2021-04-02 08:52:37
Python打印语法从2.x更改为3.x。
Python 2.x语法
print "something"Python 3.x
print("something")https://stackoverflow.com/questions/66912965
复制相似问题