Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
antonaks
Creator II
Creator II

Execute from Qlikview load script for Python file

Dear colleagues,


I have issue with Execute statement in load script when I try to run the python file.

Script runs with success when I run it without qlik (just pushed enter on it), or when I input it in cmd file and run from command file.


But  it doesn't execute when I use Execute in Qlik load script. Even when I input python script file path in cmd file, and execute cmd.

I'm asking for help.


For information, I have already used this variants (doesn't work):

  • EXECUTE C:\PycharmProjects\ODS_Data_Observer\data_observer.py;
  • EXECUTE Python3 C:\PycharmProjects\ODS_Data_Observer\data_observer.py;
  • EXECUTE cmd.exe /C  C:\PycharmProjects\ODS_Data_Observer\New Text Document.cmd;
  • EXECUTE C:\...\Python\Python36-32\python.exe C:\PycharmProjects\ODS_Data_Observer\data_observer.py;


"Can Execute External Programs" checkbox is enable.


1 Solution

Accepted Solutions
antonaks
Creator II
Creator II
Author

I solved my issue. It works when Qlik application and script situated in the same folder.

View solution in original post

9 Replies
antonaks
Creator II
Creator II
Author

up

dapostolopoylos
Creator III
Creator III

You should use double quotes in order to make it work...

For example i use the following excute command with success:

EXECUTE cmd.exe /c del "\\QLIKVIEW_SRV\E$\QV_CommonStorage\Actual_tmp.qvd";

Father/Husband/BI Developer
antonaks
Creator II
Creator II
Author

I tried this approach too, but it doesn't work.

antonaks
Creator II
Creator II
Author

up

marco_almeida
Creator II
Creator II

Hi Anton.

Try this:

Execute cmd /C "cd E:\Qlikserver\03.Utils && python script.py"

Grupo Telegram Qlik Brasil: https://t.me/joinchat/AeRmnUmcxQ02L00g3x-HtQ
cwolf
Creator III
Creator III

Hi Anton

I often use Python in QV script and it works without any problems, also with parameters for python script.

For example:

set csvPath='$(sData)\$(sDataArea)\$(vVersion)\Export_PSP.csv';

Store PSP into [$(csvPath)](txt);

let csvPath=Replace('$(csvPath)','\','/');

set pythonExe = 'c:\Tools\WinPython-64bit-3.6.3.0Qt5\python-3.6.3.amd64\python.exe';

set pyScripts = '\\server\Scripts\Py';

EXECUTE $(pythonExe) $(pyScripts)\HR_Counter.py -csv "$(csvPath)";

- Christian

antonaks
Creator II
Creator II
Author

It is very weird situation.

In my local PC (at work) it doesn't works, but in server it works and in my home PC works too.

Maybe I should make additional tune in Windows?

antonaks
Creator II
Creator II
Author

maybe I should make additional tune in Windows?

Because at one PC it works, and in another doesn't.

antonaks
Creator II
Creator II
Author

I solved my issue. It works when Qlik application and script situated in the same folder.