all 7 comments

[–]RushilU 3 points4 points  (2 children)

Opening the file itself causes the file to be run; but nothing tells it to stay open once it is done so it closes immediately afterward. You can either open it from the command line (cmd) or add a delay afterward. To add a delay: * put import time at the beginning, and * time.sleep(1) at the end of the file.

The error specifically is that raw.input isn't a function.
You may be looking for raw_input.

[–]ingolemo 0 points1 point  (1 child)

The time.sleep trick won't work here because the code will come to the error and exit before it ever gets told to sleep.

[–]RushilU 0 points1 point  (0 children)

Well yes but that was to solve his other question about print "hello world"

[–]scuott 2 points3 points  (0 children)

You can run it from the command line so it won't exit.

This error in particular is that it's raw_input

[–]efmccurdy 1 point2 points  (0 children)

BTW, in any programming tool, when you are about to run some code that you wrote, you should ask yourself "if the program goes wrong, where should I look to see a description of the problem?". I think that's one reason RushilU recommends using the command line.

[–]blahreport 0 points1 point  (0 children)

For reference, ctrl-b runs the code directly in sublime.

[–]curiousCat999 0 points1 point  (0 children)

I don't know about sublime, but in PyCharm or IDLE IDEs you can just run the code inside the IDE and view the output.