在python中使用dir()函數查看當前變量,具體方法如下:
1.首先,在python中導入string模塊;
import string
2.string模塊導入后,使用string模塊中的dir()函數即可查看查看所有變量;
print(dir(string))