shokwave comments on PSA: Learn to code - Less Wrong

34 Post author: John_Maxwell_IV 25 May 2012 06:50PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (77)

You are viewing a single comment's thread. Show more comments above.

Comment author: John_Maxwell_IV 26 May 2012 07:58:13PM *  5 points [-]

Typically people use a keyboard shortcut to save, which makes it less painful.

For running your program, try typing

python yourprogram.py

from your console/terminal/whatever after having navigated (by typing "cd directoryname" and "dir"/"ls" repeatedly) to the directory where your program is. After having typed the execution command once, you can just push the up arrow on your keyword to restore that command on the command line. So under ideal conditions, executing your program should consist of four actions: pushing a keyboard shortcut to save, switching to a terminal window, pushing the up arrow key, and pushing enter.

Probably the instructions I just gave you will be hard to follow because they are awfully compressed and I don't know your platform. So feel free to tell me if you run into a problem. You may wish to make an explicit effort to learn the command line; I believe there is a Hard Way book about it.

Another option is to use the editor that comes shipped with Python, sometimes referred to as IDLE. Once you figure out where it is and start it running, go to the file menu and choose new document or something like that. Then press F5 at any time. It should prompt you to save and then run your program. (If I recall correctly.)

I'm sure there's something unclear here, so please respond if you get stuck.

Comment author: Tripitaka 27 May 2012 03:30:08AM -1 points [-]

Thank you very much for your elaborate reply. Unfortunately I do seem to have miscommunicated; those steps as described by you are exactly what I dread. I feel like I do not know enough to ask the right questions, so: I want a program which lets me debug with as less actions as possible while also giving me easily accessible help/documentation. They seem to be called IDEs.

Comment author: shokwave 27 May 2012 02:56:29PM 1 point [-]

This may or may not be helpful, but it sounds like you might have a use for guard which is unfortunately quite obtuse to set up, but once it's running, it will automatically perform arbitrary tasks each time the file changes. If I plan to debug something, I tend to go build a Guardfile that runs that something every time I change it. Now the steps are:

  1. Cmd-S to save.
  2. Lazily cast eyes over the other half of my screen to see results.