Jump to content
We've recently updated our Privacy Statement, available here. ×

How to pass argument parameters of a python script in IronPython

Hung Huynh

Recommended Posts



I am currently running a python script in IronPython. How do I pass the argument parameters of my python script into IronPython

p = Process()

p.StartInfo.UseShellExecute = False

p.StartInfo.RedirectStandardOutput = True


#Include python executable program path location

p.StartInfo.FileName = "C:Anaconda3python.exe"


#Include python script file name

p.StartInfo.Arguments = "BubbleSort.py"

p.Start()Some background info, my python script produces an excel file on my computer so I would like to know the location of that file. That way I can run the rest of my IronPython code that will allow me to open that said file and import to Spotfire. Currently when I hit run in Spotfire, it seems like my python script doesn't execute and produce the excel file, however python script works since I have tested it through a typical Python client (Jupyter Notebook).

I know the below code works however I need help with the argument parameters for my script. Thank you.

clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c')


from Microsoft.Office.Interop import Excel


OpenFile = OpenFileDialog()


filePath = OpenFile.FileName



#specify any settings for the file

settings= TextDataReaderSettings()

settings.Separator =","





#datasource name and datasource to add table


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...