Python tutorial instructions not working

0

I am trying to follow the instructions in the python tutorial for AWS Cloud 9. When I did step 2 it said that python was already installed, but I went to do step 3 and the instructions are suddenly wrong. 1. In the AWS Cloud9 IDE, on the menu bar choose Run, Run Configurations, New Run Configuration.

2.On the [New] - Stopped tab, enter hello.py 5 9 for Command. In the code, 5 represents sys.argv[1], and 9 represents sys.argv[2].

3.Choose Run and compare your output.

These are the instructions. Firstly, I started a whole new IDE. When I went to do no.1 you don't even use that menu to start the "stopped tab" you have to click on the + sign next to the terminal your already running to get the "stopped tab" to pop up. So I finally figured that out, cool. Now to change the file name from "untitled" to "hello.py" i had to click on the "x" as if to close the file before it would change the name. Ok so i got that done, cool. Now i tried to run the code according to the instructions and this is what i got:

Hello, World! The sum of 2 and 3 is 5. Traceback (most recent call last): File "/home/ec2-user/environment/hello.py", line 7, in <module> sum = int(sys.argv[1]) + int(sys.argv[2]) IndexError: list index out of range

this is what its supposed to be according to the tutorial:

Hello, World! The sum of 2 and 3 is 5. The sum of 5 and 9 is 14.

So, clearly for whatever reason, this is not working correctly. So what am I supposed to do to get this to work correctly? to try to solve this problem i looked in the knowledge base to see if it was there and it wasn't.

1 Answer
1

Hello.

I created Cloud9 in my AWS account and followed the same steps and it ran successfully.
a

The steps in the document below are working fine.
https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-python.html

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • If "hello.py" has been successfully saved as a file, you can execute "hello.py 5 9" by clicking on "Run" at the top of the screen, then selecting "Run Configurations," and opening "New Run Configuration." a
    a

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions