Coding issues with Python- Truncation of Generated Code

I have been using chatgpt-4o to create python scripts–one in particular. The code has grown in the past 2 hours as I have added features, and I am running into the problem of chatgpt truncating prematurely before it has completed generating the python code. It would be difficult to reproduce and show here in this forum since the code is fairly long. Has anyone else had an issue where code is being produced and then that production ends or is truncated?

Do you have a “continue” button that appears? That UI element is produced when the maximum output token limit is reached, and ChatGPT has an ability not given to API users to call again to continue the output generation.

If you don’t have “continue” right after the AI stops, then it is likely that your output was just curtailed by the AI and the signals that it gets that the writing is longer than desired.

The good news is that I do have a Continue button in the web-based interface, however, I had been using the Mac app where there isn’t one. There is a >> button but the code generation gets a bit weird as it continues not storing everything in one single frame. Thanks for the suggestion.