Hi all, I am not a Python guru by any means and I am having an issue that I hope I can get help with I have a running instance of SPSS – with open ouptut and syntax documents (just one of each) I run a simple Python program block within the running SPSS session BEGIN PROGRAM PYTHON. import sys import spss #; help(spss) sys.path.insert(0, r"C:\Work_Home\MergeDev") import TWHV23MergeSigTest TWHV23MergeSigTest.MergeRoutine() END PROGRAM. to format my output (this just deletes notes, warnings etc – essentially leaving just the tables) and this runs no problem. Now I want to add within the TWHV23MergeSigTest python function a call to run a ‘sbs’ script. (this is a pre 16 script I wrote that I figure wont run – but the first step is to try and run it and I cant do that). I have tried the following syntax try: Submit(r""" SCRIPT "C:\Work_Home\MergeDev\TESTTIMHMergeTestingScriptV4.sbs". """) except: raise and I get an error identifying Submit(r””” NameError: global name ‘Submit’ is not defined I am confused as to why I cant run Submit at this point? Thanks! ********************************* Notice: This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, do not use the information, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Email transmissions cannot be guaranteed to be secure or error free. The sender therefore does not accept any liability for errors or omissions in the contents of this message that arise as a result of email transmissions. |
This line
Submit(r""" should be spss.Submit(... Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Tim Hennigar <[hidden email]> To: [hidden email] Date: 06/01/2015 09:37 AM Subject: [SPSSX-L] Python question Sent by: "SPSSX(r) Discussion" <[hidden email]> Hi all, I am not a Python guru by any means and I am having an issue that I hope I can get help with I have a running instance of SPSS – with open ouptut and syntax documents (just one of each) I run a simple Python program block within the running SPSS session BEGIN PROGRAM PYTHON. import sys import spss #; help(spss) sys.path.insert(0, r"C:\Work_Home\MergeDev") import TWHV23MergeSigTest TWHV23MergeSigTest.MergeRoutine() END PROGRAM. to format my output (this just deletes notes, warnings etc – essentially leaving just the tables) and this runs no problem. Now I want to add within the TWHV23MergeSigTest python function a call to run a ‘sbs’ script. (this is a pre 16 script I wrote that I figure wont run – but the first step is to try and run it and I cant do that). I have tried the following syntax try: Submit(r""" SCRIPT "C:\Work_Home\MergeDev\TESTTIMHMergeTestingScriptV4.sbs". """) except: raise and I get an error identifying Submit(r””” NameError: global name ‘Submit’ is not defined I am confused as to why I cant run Submit at this point? Thanks! ********************************* Notice: This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, do not use the information, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Email transmissions cannot be guaranteed to be secure or error free. The sender therefore does not accept any liability for errors or omissions in the contents of this message that arise as a result of email transmissions. ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (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 [hidden email] (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 |
Ahh - the forest for trees – thank you! Thanks! (W) 416-947-7807 (H) 905-987-3250 ********************************* Notice: This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, do not use the information, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Email transmissions cannot be guaranteed to be secure or error free. The sender therefore does not accept any liability for errors or omissions in the contents of this message that arise as a result of email transmissions. From: Jon K Peck [mailto:[hidden email]] This line
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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 |
From: Tim Hennigar <[hidden email]>; To: <[hidden email]>; Subject: Re: [SPSSX-L] Python question Sent: Mon, Jun 1, 2015 3:54:22 PM
|
Free forum by Nabble | Edit this page |