Hey!
I'm creating a simple function. The point would be to quit the code if n_files//n_pts is not an integer, however I can't get the condition to work: now it just prints 'Done', no matter if the result is an integer. I tried adding == True after the if command, but that doesn't do anything, so if anyone could help me on this one, I'd greatly appreciate it!
I'm creating a simple function. The point would be to quit the code if n_files//n_pts is not an integer, however I can't get the condition to work: now it just prints 'Done', no matter if the result is an integer. I tried adding == True after the if command, but that doesn't do anything, so if anyone could help me on this one, I'd greatly appreciate it!
print('Checking that n_files divided by n_pts is an integer...')
if isinstance(n_files//n_pts, int):
print('Done!')
else:
print('Not an integer, check the number of files in your folder')
quit()EDIT: Problem solved by changing command to if n_files//n_pts == int and using sys.exit() to quit the process!
