<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Run another python script via a batch file in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/run-another-python-script-via-a-batch-file/m-p/507146#M39872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A little bit more python than gis question. Sorry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;script:&amp;nbsp; main.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;script:&amp;nbsp; child.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;batch file: run.bat&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;main.py basically loads feature class data into SDE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so during gp.Append_management(my_source, my_target, "NO_TEST") I wish a sperate command window to open and run child.py which reports back a row count every 10 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In main.py I want to pass two parameters to run.bat (fc_name, total_count)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The run.bat file will then pass on these parameters to child.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code in main.py should continue running and child.py should open in a sperate command window - hence why I though about via a .bat file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried os.spawn, subprocess.call, os.popen, os.startfile but sadly without success.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help me with the syntax in main.py, run.bat and child.py to achieve this? Advice appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Aug 2012 11:31:07 GMT</pubDate>
    <dc:creator>JamesMorrison1</dc:creator>
    <dc:date>2012-08-31T11:31:07Z</dc:date>
    <item>
      <title>Run another python script via a batch file</title>
      <link>https://community.esri.com/t5/python-questions/run-another-python-script-via-a-batch-file/m-p/507146#M39872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A little bit more python than gis question. Sorry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;script:&amp;nbsp; main.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;script:&amp;nbsp; child.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;batch file: run.bat&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;main.py basically loads feature class data into SDE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so during gp.Append_management(my_source, my_target, "NO_TEST") I wish a sperate command window to open and run child.py which reports back a row count every 10 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In main.py I want to pass two parameters to run.bat (fc_name, total_count)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The run.bat file will then pass on these parameters to child.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code in main.py should continue running and child.py should open in a sperate command window - hence why I though about via a .bat file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried os.spawn, subprocess.call, os.popen, os.startfile but sadly without success.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help me with the syntax in main.py, run.bat and child.py to achieve this? Advice appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 11:31:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-another-python-script-via-a-batch-file/m-p/507146#M39872</guid>
      <dc:creator>JamesMorrison1</dc:creator>
      <dc:date>2012-08-31T11:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Run another python script via a batch file</title>
      <link>https://community.esri.com/t5/python-questions/run-another-python-script-via-a-batch-file/m-p/507147#M39873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://stackoverflow.com/questions/1186789/what-is-the-best-way-to-call-a-python-script-from-another-python-script"&gt;This&lt;/A&gt;&lt;SPAN&gt; might be a helpful article.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 11:53:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-another-python-script-via-a-batch-file/m-p/507147#M39873</guid>
      <dc:creator>ChristopherBlinn1</dc:creator>
      <dc:date>2012-08-31T11:53:51Z</dc:date>
    </item>
  </channel>
</rss>

