<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clearLayout(layout):
 """Removes all widgets in the layout. Useful when opening a new file, want to clear everything."""

    while layout.count():
        child = layout.takeAt(0)
        child.widget().deleteLater()