其中的关键是spssaux模块,它与pythonsessentials一起安装在spss23中(可能不在旧版本中,但我无法测试它)。IBM论坛上的this old post积分。在
begin program.
import spss,spssaux
#this gets the whole path+filename+fileextension into a string:
Data_Info=str(spssaux.GetDatasetInfo())
#find the position of the last "/" in the above string, to determine the path
Slash_Pos=Data_Info.rfind("/")
#find the position of the last ".", to determine file extension
Ext_Pos=Data_Info.rfind(".")
#get Active File name
SPSS_Name = Data_Info[Slash_Pos+1:Ext_Pos]
#get Active File Path
SPSS_Path=Data_Info[:Slash_Pos+1]
print (SPSS_Name, SPSS_Path)
end program.
其中的关键是spssaux模块,它与pythonsessentials一起安装在spss23中(可能不在旧版本中,但我无法测试它)。IBM论坛上的this old post积分。在
是的,这个功能已经有很长时间了。请注意,活动数据集并不总是有文件名。在
相关问题 更多 >
编程相关推荐