CS 115 Lab 1, Part D: Run a text-based Python program on the CS department server

[Back to Lab 1 instructions]


Instructions

  1. Exit IDLE, if you have not already done so.
  2. Run your text-based program on cwolf by typing a command:
    python3 lab01.py
  3. When prompted, type Transformers for the movie. Here is an example of what your program should do. In this example, the user's input is underlined and italicized, and the rest of the text should be printed by your program:
    What is your favorite movie? Transformers
    Ugh, Transformers is a terrible movie.
  4. Run your program again. This time, type Mission Impossible for the movie. This is what you should see:
    What is your favorite movie? Mission Impossible
    Ugh, Mission Impossible is a terrible movie.
  5. Next, you'll use a text-based editor called emacs to modify your program. Remember that you won't be able to use the mouse to move around in the file; you'll only use the cursor keys. This will be tedious at first, but Emacs has a lot of keyboard shortcuts you can learn to make this simpler. You can learn more at the course resources website. To edit your program in emacs, type
    emacs lab01.py
  6. Once you have your program in emacs, make the following changes (if necessary):
  7. To save your program and exit from emacs, hit CTRL-x followed by CTRL-c. Then, if you made any changes that you want to save, press y.
  8. If you made changes, run the command from Step 2 to run your program again.
  9. Type this command to run some automated tests on your program:
    ~srivoire/cs115/pickup/test.sh lab01 lab01.py
    If your program's output matched the text output exactly, then you will see an "OK." Otherwise, you will see a URL. After two minutes, paste this into your web browser to see the differences between your output and the sample output. (If you do not wait long enough, you will see an "Access forbidden!" message.) Fix your program and try again.
  10. When your program's behavior matches the samples exactly, flag down the instructor or student assistant to demo your program. This demo is part of your lab grade, so don't skip it! You can redo the demo as many times as necessary until you get it perfect.
  11. Once you have done the demo and are happy with your program, continue to Part E.