Say I write an application that prompts the user to enter an integer. If the user enters a double or string or anything, anything not an integer an error will appear. I'm having trouble writing code to combat this problem so I can errorproof my application.

I'm thinking I'll need to use a while loop to continually ask the user for an integer if they keep inputting something that's not an integer.

that'd be a good way

You're on the right track! To error-proof your application and ensure that the user inputs an integer, you can use a combination of a while loop and some exception handling.

Here's an example code snippet that demonstrates how to achieve this in Python:

```python
while True:
try:
user_input = int(input("Please enter an integer: "))
break # Break out of the loop if the user enters a valid integer
except ValueError:
print("Invalid input! Please enter an integer.")

# Rest of your code...
```

Let's break down what's happening here:

1. We start an infinite while loop using `while True`.
2. Inside the loop, we use a `try-except` block to capture any `ValueError` that may occur when converting the user's input to an integer.
3. We prompt the user to enter an integer using `input("Please enter an integer: ")`.
4. If the conversion to `int` is successful (`user_input = int(input(...))`), we break out of the loop using `break`.
5. If the conversion raises a `ValueError` exception (meaning the user entered something other than an integer), we print an error message and the loop continues to prompt the user for an input.

You can place any additional code or logic you want after this loop to continue with your application.

By using this approach, your application will continually ask the user for an input until they enter a valid integer, ensuring that erroneous inputs are handled gracefully.