Python Scripts with Input and Output
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-01-20 08:45 AM
Hi
I want to execute a Python script and take back the output it gives (may be text).
Earlier I downloaded the latest Environment utility having action "Start Process Read Stderr and Stdout".
When I execute the script using the "Start Process" action it executes fine, but it is not able to accept any response.
The new action is giving me error "Internal : Could not execute code stage because exception thrown by code stage: The specified executable is not a valid application for this OS platform."
I am having 64 bit Windows 10 laptop.
Python code:
import sys
sys.stdout.write('Returning from Python\n')
sys.stdout.flush()
sys.exit(0)
Is there any other way to it? I know writing to a file is an option, but I am taking it as a last resort.
------------------------------
Nikhil Sathe
Sr Consultant
Capgemini Technology Services
------------------------------
I want to execute a Python script and take back the output it gives (may be text).
Earlier I downloaded the latest Environment utility having action "Start Process Read Stderr and Stdout".
When I execute the script using the "Start Process" action it executes fine, but it is not able to accept any response.
The new action is giving me error "Internal : Could not execute code stage because exception thrown by code stage: The specified executable is not a valid application for this OS platform."
I am having 64 bit Windows 10 laptop.
Python code:
import sys
sys.stdout.write('Returning from Python\n')
sys.stdout.flush()
sys.exit(0)
Is there any other way to it? I know writing to a file is an option, but I am taking it as a last resort.
------------------------------
Nikhil Sathe
Sr Consultant
Capgemini Technology Services
------------------------------
2 REPLIES 2
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-01-20 11:06 AM
As far as i know can't run python scripts in the compiler
------------------------------
Cohen
RPA Developer
Romania
------------------------------
------------------------------
Cohen
RPA Developer
Romania
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-01-20 12:38 PM
It sounds like you're trying to call a file that doesn't work to execute. I'm not super familiar with Python, but if I remember right, you probably need to call Python in the command line and pass the file as a parameter.
Doing a quick google search, what I said above seems to make sense for Python's .py files. https://stackoverflow.com/questions/57638802/the-specified-executable-is-not-a-valid-application-for-this-os-platform
Try calling CMD and passing whatever arguments are expected such as the "/C python A.py" etc. as the post on stackoverflow indicates.
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
Doing a quick google search, what I said above seems to make sense for Python's .py files. https://stackoverflow.com/questions/57638802/the-specified-executable-is-not-a-valid-application-for-this-os-platform
Try calling CMD and passing whatever arguments are expected such as the "/C python A.py" etc. as the post on stackoverflow indicates.
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
