num = int(str);

This function can also take an optional radix. You can find the documentation at 2.1 Built-in Functions (scroll down).