The code:
width, height = map(int, input().split())
def rectanglePerimeter(width, height):
return ((width + height)*2)
print(rectanglePerimeter(width, height))
Running it as this produces:
% echo "1 2" | test.py
6
The problem is that the IDLE is simply passing a single string to your script. So such simple pipes only let you pass a single string, what you can do is to process this string, split it on whitespace, and convert the string fragments to ints yourself.
You can also covert your input to ints like this:
width = int(input())
height = int(input())
I hope this helps.