from functions import is_int_string, generate_files import sys if len(sys.argv) == 1 or len(sys.argv) == 2: sys.exit("Arguments missing. Exit.") number_of_particles = sys.argv[1] area_length = sys.argv[2] if not is_int_string(number_of_particles): sys.exit("Must be integer. Exit.") generate_files(int(number_of_particles), float(sys.argv[2]))
from functions import is_int_string, get_radius, get_area_length, generate_files import sys number_of_particles = input("Enter number of particles N: ") area_length = get_area_length() particle_radius = get_radius() if not is_int_string(number_of_particles) or not is_int_string(area_length): sys.exit("All arguments must be integers. Exit.") generate_files(int(number_of_particles), area_length, particle_radius)