Edit:
ss.expect
takes any string as a regular expression, and uses it to search the output from a program. In your case, if you want to match the line before all the dashes, you can do
ss.expect(r'TCP window size: .*yte \(default\)')
More broadly, I'm not sure what you're trying to accomplish with this, but it might be helpful to look at this page.
Old:
I'm not sure what you mean when you say that you expect a blank space as prompt.
1) Is it really a space? If so ss.expect(' ')
seems like it should work.
2) Is there an end of line? If so ss.expect('\n')
seems like it should work.
3) Does iperf
really give you a prompt? Is it really waiting for input? And you're sending an EOF? Does this kill the program?