<?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 Re: Pass variable from VB.net to Python. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292302#M22625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Paul for all the help, I also thank James, Xander and Joe.&amp;nbsp; This was a learning experience.&amp;nbsp; This issue was how the shell command was constructed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had been trying the following without success:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turned out I had double quotes between the exe and arguments, took those out and it works fine.&amp;nbsp; I took out the addition of the space after the file name just to clean it up a little.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VB.net&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;Dim A1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"ExcelFile.xlsx"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; A2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"DbfFile.dbf"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;Turned out I had double quotes between the exe and arguments, took those out and it works fine.&amp;nbsp; I took out the addition of the space after the file name just to clean it up a little.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"C:\Python27\arcGIS10.2\python.exe C:\PythonScripts\ExceltoDBF.py &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be posting my next issue, I want to stop execution of the VB program while the Python script runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course it is an issue with the sctructure of the exe and the arguments to Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dale,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2014 17:40:12 GMT</pubDate>
    <dc:creator>DaleShearer</dc:creator>
    <dc:date>2014-11-26T17:40:12Z</dc:date>
    <item>
      <title>Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292290#M22613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks for looking at my question.&amp;nbsp; From searching on the internet either this cannot be done, or what code I find does not work.&amp;nbsp; It shows the VB.net side, but not what has to be done on the Python side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should be simple, I have a form in VB.net where the user selects an excel file to be converted to a dbf file then added to a geodatabase.&amp;nbsp; I can hard code the file and geodatabase name into my python script and it works fine.&amp;nbsp; I can run the script (with the hard coded names within) from my VB.net form, works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is when the user selects a file name from the listbox, that file name is then sent to the Python script as a variable when the script is called from VB.net.&amp;nbsp; Then within the Python script it picks up that variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I even close as to how I think this should work.&amp;nbsp; Dale,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 21:13:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292290#M22613</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-11-20T21:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292291#M22614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm neither an expert in vb.net or python, but back in the olden days, when I had more hair and none of it was gray, the operating system of choice was unix. We would write a variable name to a text file, and then open that file to read the contents.&amp;nbsp; We moved variables back and forth from AML to C or Bourne shell scripts that way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 21:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292291#M22614</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2014-11-20T21:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292292#M22615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this site can help you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.python.org/3.3/library/sys.html#sys.argv" title="https://docs.python.org/3.3/library/sys.html#sys.argv"&gt;28.1. sys — System-specific parameters and functions — Python 3.3.6 documentation&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;Although this is 3.3 documentation, it will also work for python version 2.x&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this site:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.diveintopython.net/scripts_and_streams/command_line_arguments.html" title="http://www.diveintopython.net/scripts_and_streams/command_line_arguments.html"&gt;10.6. Handling command-line arguments&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 21:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292292#M22615</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-11-20T21:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292293#M22616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This &lt;A href="http://www.tutorialspoint.com/python/python_command_line_arguments.htm" title="http://www.tutorialspoint.com/python/python_command_line_arguments.htm"&gt;Python - Command Line Arguments&lt;/A&gt;&amp;nbsp; was a good tutorial on processing incoming arguments in a python script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This &lt;A href="http://stackoverflow.com/questions/13807860/execute-python-script-from-vb-net" title="http://stackoverflow.com/questions/13807860/execute-python-script-from-vb-net"&gt;.net - execute python script from vb.net - Stack Overflow&lt;/A&gt; has a good example of executing the python script from .NET application including the arguments. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 13:17:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292293#M22616</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-11-21T13:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292294#M22617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James is right. The answer is to pass args to the python script from the command line. The only other option is using Iron Python, but that is overkill. Just accept args and then use the process execute python.exy myprogram.py param1 param 2....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 15:14:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292294#M22617</guid>
      <dc:creator>PaulCrickard1</dc:creator>
      <dc:date>2014-11-21T15:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292295#M22618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to thank you all for your help, I have learned more in looking at the links you gave me.&amp;nbsp; But I am still stumped, It must be from years in VBA to VB.net land, then figuring out Python as I go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see (I think) how it works, but I am stuck on this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a shell command to call my Python script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;Shell("C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py""")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine as I have the Excel file name and dbf file name hardcoded.&amp;nbsp; Now the way I see it I can pass the two file names via the arg1 and arg2 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;Shell("C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py arg1 arg2""")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I set up the arg1 and arg2 variables so that they are recognized by the Shell command?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may not be asking the right thing the right way, I am just trying to figure out how to set the varaibles to the file names so that they can be passed to the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not wanting anyone to do this for me, I have not grasped how to do this yet, just point me the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Dale&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 20:16:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292295#M22618</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-11-25T20:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292296#M22619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I think I made some progress, here is my current shell command structure, it does not die in VB.Net and it calls the script.&amp;nbsp; No, I do not have the script side done, hopefully this is the correct structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;Dim A1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"ExcelFile"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; A2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"DbfFile"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dale,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 20:37:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292296#M22619</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-11-25T20:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292297#M22620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks good. On the python side, import sys. Then you will have an array named sys.argv. You don't have to do anything to add data to it, it is already there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sys.argv[0] will be the file name (ExceltoDBF.py)&lt;/P&gt;&lt;P&gt;[1] through &lt;N&gt; will be the command line arguments. So think of the args as being indexed at 1.&lt;/N&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 21:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292297#M22620</guid>
      <dc:creator>PaulCrickard1</dc:creator>
      <dc:date>2014-11-25T21:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292298#M22621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Paul, I am getting there.&amp;nbsp; Your explanantion of the sys.argv really helps, I might of blown over it, or read it and did not understand at the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From within python I ran a simple routine of&amp;nbsp; print 'Argument List:', str(sys.argv) and I got the file name just like you said.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am working on the two variables I am passing in, so I am thinking it should work this way:&amp;nbsp; (which is not working)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VB.net&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;Dim A1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"ExcelFile"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; A2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"DbfFile"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.ExcelToTable_conversion(sys.argv[1],sys.argv[2])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it all right here in front of me, I just have to see how it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dale,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 21:39:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292298#M22621</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-11-25T21:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292299#M22622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That looks like it should work.&lt;/P&gt;&lt;P&gt;If it doesn't you may need to add&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;env&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;workspace&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s" style="color: #a31515;"&gt;"c:/data"&amp;nbsp; #wherever the files are or use the path as a parameter.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 21:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292299#M22622</guid>
      <dc:creator>PaulCrickard1</dc:creator>
      <dc:date>2014-11-25T21:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292300#M22623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At least I am not too far off. I do have the arcpy.env.workspace in the Python Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the more accurate code, I had left off the file extensions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VB.net&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;Dim A1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"ExcelFile.xlsx"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; A2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"DbfFile.dbf"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python Script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import sys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "C:/PythonScripts"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.ExcelToTable_conversion(sys.argv[1],sys.argv[2])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ExelFile.xlsx is in the C:/PythonScripts folder, when the python script runs it will create the DbfFile.dbf and place it in the same folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I get this to work the input and output files will be in and go to different places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it goes to run the Python script the lack window pops up and closes instantly.&amp;nbsp; When I run the script with the hard coded file names it stays open until the processing is done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 22:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292300#M22623</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-11-25T22:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292301#M22624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you execute in VB it closes when done - which is usually what you want when calling from an external program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the /K keeps it open&lt;/P&gt;&lt;P&gt;cmd /K C:\anaconda\python.exe C:\users\me\desktop\line.py arg1 arg2 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 22:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292301#M22624</guid>
      <dc:creator>PaulCrickard1</dc:creator>
      <dc:date>2014-11-25T22:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pass variable from VB.net to Python.</title>
      <link>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292302#M22625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Paul for all the help, I also thank James, Xander and Joe.&amp;nbsp; This was a learning experience.&amp;nbsp; This issue was how the shell command was constructed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had been trying the following without success:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turned out I had double quotes between the exe and arguments, took those out and it works fine.&amp;nbsp; I took out the addition of the space after the file name just to clean it up a little.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VB.net&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;Dim A1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"ExcelFile.xlsx"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; A2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: 10pt;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"DbfFile.dbf"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"C:\Python27\arcGIS10.2\python.exe ""C:\PythonScripts\ExceltoDBF.py"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt;Turned out I had double quotes between the exe and arguments, took those out and it works fine.&amp;nbsp; I took out the addition of the space after the file name just to clean it up a little.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shell(&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"C:\Python27\arcGIS10.2\python.exe C:\PythonScripts\ExceltoDBF.py &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A1 + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: 10pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: 10pt;"&gt; + A2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be posting my next issue, I want to stop execution of the VB program while the Python script runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course it is an issue with the sctructure of the exe and the arguments to Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dale,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 17:40:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-variable-from-vb-net-to-python/m-p/292302#M22625</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-11-26T17:40:12Z</dc:date>
    </item>
  </channel>
</rss>

