Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Run Command Tool and .py

knozawa
11 - Bolide

Hello,

 

Does anyone know if we always have to use .exe to run the run command tool or if we can use .py? 

 

Although write source and read results are optional in run command tool, I got an error message that the tool requires an input or output file to specify.

 

Sincerely,

Kazumi

8 REPLIES 8
KaneG
Alteryx Alumni (Retired)

Hi @knozawa,

 

You can use .py as well. You can run anything that you can run from a command prompt. 

 

The error message you have is correct, you need either an input or an output. If you don't need it, then just attach a text input with a dummy field and write it to %temp%\e.1 or something similar.

knozawa
11 - Bolide

@KaneG,

 

Thank you for your reply.  I'm still getting an error message.

This is my Run Command Tool configuration.

Run Command Tool Configuration.png

I also attached a sample workflow.

 

Thank you,

Kazumi

KaneG
Alteryx Alumni (Retired)

This is because you had a browse tool afterwards and nothing in the Read results.

Process:

Anything that is connected to the In put of the Run Command will write out to 'Write Source'

The Run External Program part will run

Anything in Read Results will write out to the Output of the Run Command Tool

 

So, if you have something connected to the input, then 'Write Source' will need to be completed. If you have anything connected to the Output, 'Read Results' will have to be filled out. One of those, has to be connected.

 

Run_Command_with_Arrows.png

knozawa
11 - Bolide

@KaneG,

 

Thank you for your response.  If I want to use a Run Command Tool in the middle of the workflow, I cannot use the tool because I need either input or output tool, is that correct?  Is there any way that the run command tool can read the incoming data using read.Alteryx("#1", mode="data.frame") like a R tool?

 

 

Sincerely,

Kazumi

KaneG
Alteryx Alumni (Retired)

No, the data would need to be written out to somewhere. So, whatever comes in to the Run Command Tool will be written out to the file specified in the 'Write Source'. Your Python code can then pick that file up.

 

Note: Watch out later this year for integrated Python support. If you weren't fortunate enough to make it to Inspire this year, you can check out the keynotes and sessions here

 

knozawa
11 - Bolide

@KaneG,

 

Thank you.  I will look forward to the integrated python support.

 

Sincerely,

Kazumi

Ratul
6 - Meteoroid

I have tried doing the same thing with this as you instructed . But still i am getting some error . 

Run Command (6) You must specify a sheet name.

Run Command (6) Failed to run external program "C:\Users\chowdhuryr\Desktop\Code\GUI.py": %1 is not a valid Win32 application.

 

I am also uploading a screen shot of my model with the run command tool . 

Any help will is highly appreciated . 

 

Thanks , 

Ratul . 

KaneG
Alteryx Alumni (Retired)

There are 2 separate errors here

 

  • The Sheetname error is because there is no sheetname specified on the Excel file in the Read Dialogue.
  • The other error is due to Windows not knowing how to run the py script, either call it from python.exe or add python to your environment variable in Windows.
Labels