Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

os.system/os.popen does not open cmd

yunpeng
8 - Asteroid

Hi All,

 

I'm using the python tool in atleryx to perform some automated task in excel and ran into below.

 

Issue:

os.system/os.popen works on simple cmd like calculator, but does not work on network drive cmd function.

 

Example

import os

os.system('calc'). This works

 

import os

os.system('abc')  This doesn't work  (abc is not a windows built-in cmd. It's an in-house cmd to launch specific function excel. Location of this cmd is on network drive). It would return an output of 255.

 

I've tried the full network path of the cmd. Still doesn't work

 

Using full network path of the cmd in 'event' tab in workflow configuration, this works. Also, usingi os.system in Anaconda (Python environment), 

 

Any idea why such difference? 

 

 

2 REPLIES 2
TessaS
Alteryx
Alteryx

Hi @yunpeng 

 

When you say full network path, do you mean a UNC path? It should be returning a UNC path in order for it to function. 

 

I'm not exactly sure what the difference is but I'm not surprised there is a difference. Processes in the Event tab are being executed by Alteryx while something in the Python tool will be executed by python.exe in the Jupyter notebook so it's two different engines handling that process. 

 

If executing within the Event tab is a possible solution, I would pursue that route as Python tool can have some limitations when working with Excel spreadsheets popping up. 

 

Thanks!

Tessa Smithers

Sr. Technical Account Manager
Alteryx, Inc.


yunpeng
8 - Asteroid

Hi Tessa, 

 

Thanks for taking a look. 

 

Yes I believe it's a UNC path judging from the link you sent. 

 

I also asked around internally. Turns out that I'm not allowed to incorporate command prompt into workflows, so unfornately this is a no go. Nevertheless, thank you all the same!

 

Regards

Yunpeng 

Labels