DEV Community

Bhimashankar Patil
Bhimashankar Patil

Posted on

10 1

How to run python3 using Power Automate Desktop.(Step Wise Guide)

Hi Folks, This blog is about how can we run a python3 script using Power Automate.
As of now, Power Automate desktop supports Python 2.7 which has limitations.

Prerequisites :
1 - You need to have PAD installed. (obviously)
2 - Python3

Step 1 - Create A flow with any Name that you like.

Step 2 - Go to Action and search for "Open CMS Session".

Step 3 - Inside that give the current working directory as a Parameter.

Image description

Step4 - Again search for "Write to CMD Session" in actions and drag it under "Open CMD Session"

Image description

In "Write to CMD Session" give the command to run your python3 script.
example: cd.\PyProjects&& cd.my_script.py

Image description

Step 5 - Now again go to Actions and search for "Read from CMD Session" It will help you to see the output that is displayed on CMD.

Image description

Image description

As the Parameter just pass the instance of "Open CMD Session"

Now Save and Test your flow.

If you face any problem feel free to comment your questions.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs