Issue
I have a loop that I run via the statement:
os.system('python3 wrapper.py')
which generates some files.
And every so often it hits an error such as this:
pybullet.error: Cannot load URDF file.
Error: InMemoryFile::~InMemoryFileIO (numAllocs 1 numFrees 2
This message is printed to the terminal. I would like to know how I can automatically get my code to start running again so long as the number of files generated is less than 20.
I tried the following:
while numberOfFilesGeneratedByLoop != 20:
os.system('python3 wrapper.py')
However, it was still stopped by the same error.
Solution
python3 file.py > outputLog.txt
Log the output of your file to a .txt file, and then you can read through it. You can conditionally re-run your wrapper if the non-generic error statements are in outputLog.txt.
Answered By - FrustratedSnake Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.