0

Is there a way to execute a python script in PowerShell without using: python myfile.py

I want to execute it without using the word python

I am trying to execute the python script located in EC2 windows via SSM and Lambda. Python is not getting recognized so is there any way to execute the file without using the word python.

Thanks in advance!

0

1 Answer 1

0

Just associate the .py file ending with your python executable. I posted detailed steps for it in this answer.

Sign up to request clarification or add additional context in comments.

2 Comments

How to do it in boto3? response = ssm_client.send_command( InstanceIds=['i-*********'], DocumentName="AWS-RunPowerShellScript", # Parameters={'commands': [f'[Environment]::SetEnvironmentVariable({a}, {b})']}, ) Parameters={'commands': [f'env:Path = {path1}']}, ) Like what to keep in the commands?
@SairamRavuri You have to make this change in the Windows OS that hosts the PowerShell with which you want to execute your python script.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.