【问题标题】:SPSS print to output on startSPSS在开始时打印输出
【发布时间】:2018-01-25 10:36:39
【问题描述】:

我正在寻找一种在程序启动时打印到 SPSS 输出的方法。通过查看 SPSS 的 python documentation,我似乎找不到任何在开始时做事的实例。还是我在这里遗漏了什么?

所以在阅读了 eli-k 的评论 (startup scripts) 之后,将 StartClient_.py 放在 /extensions 目录中应该很容易,但这似乎也不起作用..

#StartClient_.py
import SpssClient

SpssClient.StartClient()
print "whatever"
SpssClient.StopClient()

【问题讨论】:

  • 你应该查一下spss startup scripts(我自己没用过,但我认为这对你有用)
  • 看起来很有希望,但我无法让它发挥作用。见编辑。

标签: python spss


【解决方案1】:

OUTPUT EXPORT 会有帮助吗?您可以随时在代码中运行此命令,并结合OUTPUT CLOSE ALL 将许多单独的输出写入 RTF 或其他格式。

【讨论】:

  • hmmm.. 我需要在 /extensions 目录中放置一个脚本,以便在每次 SPSS 启动时运行。
  • Google Raynald 的作品:Option Explicit Sub Main Dim objOutputDoc As ISpssOutputDoc Dim strParam As String Dim strPath As String Dim strFileName As String Set objOutputDoc=objSpssApp.NewOutputDoc ' ******** 改下根据需要 2 行 strPath = "c:\\temp\\" strFileName = "FileName.spo" '给出输出文档的路径和文件名 objOutputDoc.SaveAs( strPath & strFileName) 'objSpssApp.OpenOutputDoc (strPath & strFileName) 'objOutputDoc .Close '设置 objOutputDoc=objSpssApp.GetDesignatedOutputDoc 'objOutputDoc.Visible=True 设置 objOutputDoc=Nothing 结束子
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-15
  • 1970-01-01
  • 1970-01-01
  • 2016-03-04
  • 2020-02-11
相关资源
最近更新 更多