Question: Trying to detect and respond to key presses in Python. Am using IDLE and Python 3.3. I have the following code so far

```
import msvcrt

while True:
   inp = ord(msvcrt.getch())

   if (inp != 255):
      print(inp)

```

I have the IF statement because if I just allow the script to throw out the value of 'inp' it just spoons out 255 repeatedly. So I threw in the if statement to respond to anything but 255 and now when run the code does nothing but output the actual keypress character in the shell.

Answer: 
This seems a little suspect to me - mainly because what I see is the "ajax inception" thing going on. Remember $.load() is also an ajax function, so you are calling multiple .load events as the callback to the main ajax event.

Is there a way to consolidate that into a single Ajax call, as in the first wrapper ajax you have and then let PHP set all the selects for you?

If you have to iterate through each select, I may go this route to make it a little cleaner:

```
for(var i=1; i<19; i++)
{
  $('#view'+i).load('jobs.php#view'+i); //empty callback not needed here as well..
}

```
I would do something like this...

```
// cache the views
var views = $('.view');

$('#view_wrapper').on('change', 'select', function() {
    var statusVal = $(this).val();
    var job_id = $(this).prop('id');
    $.ajax({
        type: "POST",
        url: "saveStatus.php",
        data: { statusType : statusVal, jobID: job_id },
        cache : false,
        success: function(data) {
            $(views).eatch(function() {
                var view_id = $(this).prop('id');
                $('#'+view_id).load('jobs.php#'+view_id);
            });
        }
    });
});

```