Date: Mon, 20 Jul 2009 05:05:40 -0700
Reply-To: Albert-Jan Roskam <fomcl@yahoo.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Albert-Jan Roskam <fomcl@yahoo.com>
Subject: spssaux.getShow("handles")
In-Reply-To: <24557521.post@talk.nabble.com>
Content-Type: text/plain; charset=iso-8859-1
Hello,
I have a simple Python question. I want to make a custom menu button in spss dat activates a script that opens an explorer screen for each directory that is defined in a FILE HANDLE. The following code does not work, but it illustrates what I want. In this case, it should open one explorer instance that shows d:\temp. How can I make this work?
import subprocess, os.path
import spss, spssaux
spss.Submit("file handle tmp /name = 'd:/temp'.")
for handle in spssaux.getShow("handles"):
if os.path.isdir(handle):
subprocess.Popen("explorer " + handle)
Thank you in advance for your time!
Albert-Jan
--- On Sun, 7/19/09, Bruce Weaver <bweaver@lakeheadu.ca> wrote:
> From: Bruce Weaver <bweaver@lakeheadu.ca>
> Subject: Re: Variable Reordering
> To: SPSSX-L@LISTSERV.UGA.EDU
> Date: Sunday, July 19, 2009, 4:33 PM
> William Dudley WNDUDLEY wrote:
> >
> > Yes
> > You can easily reorder variables by opening the file
> with a subset or new
> > order to the variables using the keep command
> >
> > GET
> > FILE='C: \cargiver.sav'
> > /keep =ID PQUIETTM PGROUP
> PHOBBY PSOCIAL leisure_PART .
> > DATASET NAME $DataSet WINDOW=FRONT.
> >
> > And or you can open the files and then save as a new
> file and use the keep
> > command to save a subset and or reorder the
> variables.
> >
> > SAVE OUTFILE='C:\new order caregiver.sav'
> > /keep =ID PQUIETTM PGROUP
> PHOBBY PSOCIAL leisure_PART
> > /COMPRESSED.
> >
> >
>
> Re the second method, rather than saving and then
> re-opening the file, you
> can just use MATCH FILES (or ADD FILES), like this:
>
> GET FILE='C:\new order caregiver.sav' .
>
> MATCH FILES
> file = * /
> keep =ID PQUIETTM PGROUP PHOBBY PSOCIAL leisure_PART
> ALL .
> EXE.
>
> Note the keyword ALL at the end of the KEEP line.
> This will keep all other
> variables in their current order.
>
>
> -----
> --
> Bruce Weaver
> bweaver@lakeheadu.ca
> http://sites.google.com/a/lakeheadu.ca/bweaver/
> "When all else fails, RTFM."
>
> --
> View this message in context: http://www.nabble.com/Variable-Reordering-tp24557090p24557521.html
> Sent from the SPSSX Discussion mailing list archive at
> Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU
> (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the
> command
> INFO REFCARD
>
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|