Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] - How to run Python script from Fex

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] - How to run Python script from Fex
 Login/Join
 
Platinum Member
posted
Hi All
I have a BAT file (with the python command line script) that can run from Windows.
When I try to run the same bat file from Fex. It errors out.
** Following is from the FEX

! cmd /c "cd \python36\dciscripts\ && chdir && ptocost.bat"
C:\Python36\DCIScripts
got it
C:\Python36\DCIScripts
C:\Python36\DCIScripts>python import_from_file.py -f ptoclist.csv -s http -h servername -p 8080 -r /ibi_apps/rs/ibfs -u wftestuser5 -pw xxxxx
'python' is not recognized as an internal or external command,
operable program or batch file.

Python is installed on the server and folder path is in the environment variables..

As you can see from Fex, the folder is changed to the location of the python script and where the bat file is located
Any help from someone who is familiar with this issue will be greatly appreciated

Thanks

This message has been edited. Last edited by: FOCdeveloper,


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Master
posted Hide Post
I'm wondering if you need to preface each of your commands with Queue...


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Platinum Member
posted Hide Post
I have the code as the following in the fex ..
I tried running python directly from Fex. Same error
'python' is not recognized as an internal or external command,
operable program or batch file.

-* Sample System command run from within Fex
! cmd /c "cd \python36\dciscripts\ && chdir && if exist ptocost.bat echo got it"
-* Run Bat File
! cmd /c "cd \python36\dciscripts\ && chdir && c:\python36\dciscripts\ptocost"
!pythyon "python import_from_file.py -f ptoclist.csv -s http -h dcicordevwf02 -p 8080 -r /ibi_apps/rs/ibfs -u wftestuser5 -pw 34ErdFcV"
-RUN

  


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Platinum Member
posted Hide Post
Ok I resolved it .. I found out that the python.exe file needs to be in the folder where I am running this bat file from FEX. When running this bat file in Windows CMD, it finds the python.exe due to the environment variables but I guess when running via a Fex, that path to python.exe file is not available.

This process creates RC Access List using Rest/CSV file.

C:\Python36\DCIScripts
C:\Python36\DCIScripts>python import_from_file.py -f ptoclist.csv -s http -h server -p 8080 -r /ibi_apps/rs/ibfs -u wftestuser5 -pw xxxxx
PUBLIC/PTOCOST.acl
found and adding
lspencer already a list member
PUBLIC/PTOCOST.acl
found and adding
mryan already a list member


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Platinum Member
posted Hide Post
I think there you need to add the python path to the path of the userID running the webfocus service.


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
 
Posts: 115 | Location: Brighton UK | Registered: February 19, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] - How to run Python script from Fex

Copyright © 1996-2020 Information Builders