As another alternative, you could update your Python script to write the
file to whatever directory you want it in. When you say "...in the python
code, it is impossible to write line to a file with full path...", that's
not correct. I do it all the time in my code. This is a little off-point
for this mailing list but if you want to reply with a code snippet to
provide context, I'm sure one of the experienced Python programmers on this
list could point out how to do it.

Probably an even better question is: why are you running an external Python
script at all? If the code is fairly simple why don't you just embed it in
a <script> element right within your STAX job?

---------------------------------------------------------------------------------------

Joe Veilleux
IBM/Lotus Domino Server Quality Engineering
550 King Street
Littleton MA 01460
Email: joeveill...@us.ibm.com



                                                                       
             David                                                     
             Bender/Austin/IBM                                         
             @IBMUS                                                     To
                                       Cindy Zhu <c...@fekete.com>     
             03/09/2011 07:06                                           cc
             PM                        "staf-users@lists.sourceforge.net"
                                       <staf-users@lists.sourceforge.net>
                                                                   Subject
                                       Re: [staf-users] Where is my new
                                       file?                           
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       




The Silk_Temp.inc file will be located in the directory where STAFProc.exe
was started (this can vary depending on how you started STAFProc).

You can specify the working directory for the process, and then the file
will be written in that directory. For example:

      <process>
        <location>'local'</location>
        <command>'python'</command>
        <parms>'c:/temp/UpdateSilkInclude.py'</parms>
        <workdir>'c:/tests'</workdir>
        <stderr mode="'stdout'"/>
        <returnstdout/>
      </process>

Then the output file will be located at c:/tests/Silk_Temp.inc.

Thanks,
David


                                                                       
 David Bender          11501 Burnet Rd.   Phone (T/L): 1-512-286-5315  
 STAF/STAX Development Bldg. 903-5B002    (363-5315)                   
                       Austin, TX         ITN: 23635315                
 IBM Software Group,   78758-3400         Email: bda...@us.ibm.com     
 WPLC                                                                  
                                                                       





Inactive hide details for Cindy Zhu ---03/07/2011 03:53:24 PM---Hi, I have
the following stax job to run a piece of python codeCindy Zhu ---03/07/2011
03:53:24 PM---Hi, I have the following stax job to run a piece of python
code to replace a string, and save the co
                                                                       
                                                                       
 From:          Cindy Zhu <c...@fekete.com>                            
                                                                       
                                                                       
 To:            "staf-users@lists.sourceforge.net"                     
                <staf-users@lists.sourceforge.net>                     
                                                                       
                                                                       
 Date:          03/07/2011 03:53 PM                                    
                                                                       
                                                                       
 Subject:       [staf-users] Where is my new file?                     
                                                                       





Hi,

I have the following stax job to run a piece of python code to replace a
string, and save the content to "Silk_Temp.inc". I can't find
"SIlk_Temp.inc". Where is it?

<script>
str_to_replace = 'C:/Program Files (x86)/Fekete/'
str_to_find = 'O:/FAST/Harmony/{VERSIONSTRING}/'
source_include='D:/Silk/Apps/Harmony/Include_Harmony.inc'
dest_include='C:/Include_Harmony.inc'
python_script='D:/DistributionTesting/SilkTestDistribution/UpdateSilkInclude.py'

</script>

<process>
<location>'local'</location>
<command>'python'</command>
<parms>'%s %s %s %s' % (python_script, str_to_find, str_to_replace,
dest_include)</parms>
<stderr mode="'stdout'"/>
<returnstdout/>
</process>

I also found out in the python code, it is impossible to write line to a
file with full path.

Can you please help me out?

Thanks,

Cindy
[attachment "UpdateSilkInclude.py" deleted by David Bender/Austin/IBM]
------------------------------------------------------------------------------

What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------

Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

<<inline: graycol.gif>>

<<inline: pic15116.gif>>

<<inline: ecblank.gif>>

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to