Date: Wed, 30 Dec 2009 10:05:00 -0700
Reply-To: Jon K Peck <peck@us.ibm.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Jon K Peck <peck@us.ibm.com>
Subject: Re: temp files and python
In-Reply-To: <97D6F0A82A6E894DAF44B9F575305CC90B8CFAC4@HCAMAIL03.ochca.com>
Content-Type: multipart/alternative;
I presume that you are referring to Python in external mode. External
mode generally does not use your preference settings such as for the
temporary directory. In order to set that location, create an environment
variable named
SPSSTMPDIR
with the value being a directory. Then SPSS will create a temporary
folder under that directory for each session regardless of where you run
it from.
Normally you would do this from the Control Panel
(System/Advanced/Environment Variables), but you could alternatively
create this variable in your Python code before starting SPSS. E.g.,
import os
os.environ["SPSSTMPDIR"] = r"c:\someplace"
import spss
...
HTH,
Jon Peck
SPSS, an IBM Company
peck@us.ibm.com
312-651-3435
From:
"Pirritano, Matthew" <MPirritano@ochca.com>
To:
SPSSX-L@LISTSERV.UGA.EDU
Date:
12/30/2009 08:46 AM
Subject:
[SPSSX-L] temp files and python
Sent by:
"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
Listees,
In SPSS I?ve chosen to route my temporary files to an spss_temp folder.
But when I run spss processes using spss.Submit in python the temp files
are routed to my personal temp folder under ?Documents and Settings?. How
do I change this? I?m winding up with dozens of spss temp folders that
wind up clogging things up. Do I need to use a command like tempdir in
python?
Any help, much appreciated!
Thanks
Matt
Matthew Pirritano, Ph.D.
Research Analyst IV
Medical Services Initiative (MSI)
Orange County Health Care Agency
(714) 568-5648
[text/html]