I'm not going to provide the code because it's too long. The python script involves executing a lengthy number of commands run in a while loop.

Basic structure

```
while True:
    The meat goes here
    with the odd if:
        and stuff

```

Now that I'm finished it, I'm noticing that upon running it, it uses 100% CPU, no exceptions. I'm a beginner and don't really know what to attribute this issue to. I thought that maybe because the script runs indefinitely (until I exit it manually) it might just be taxing on the CPU if it's repeating the loop a number of times a second. I added time.sleep(1) at the bottom of the while to see if that was the issue with no improvements.

Anyone have any ideas? It is quite a long sequence of events, but they are heavily dependent on an if statement which isn't triggered all that often. The 100% CPU usage occurs before that particular if statement is even triggered, so I'm really at a loss.

Edit: forgot to include that it's running in a unix environment (Debian)