ChristophSchranz / Tweaker-3

A performant auto-rotate software for objects in 3D Printing, whose parameter are trained by an evolutionary algorithm.
GNU General Public License v3.0
91 stars 25 forks source link

os.system('cls') is Windows only #27

Open tbroset opened 2 years ago

tbroset commented 2 years ago

In update_progress() you use os.system('cls'), which is not OS Independent. On a non-Windows system you will get the following errors: tweaker3 -i BODY_RIGHT.stl -x -p sh: cls: command not found Progress is: 18 sh: cls: command not found Progress is: 54 sh: cls: command not found Progress is: 90

I would suggest using something along the lines of os.system('cls' if os.name == 'nt' else 'clear') Reference: https://stackoverflow.com/a/2084628/18731807