def run(path, tasks):
	"""Run a pylpfile."""

	# Test if the pylpfile exists
	readable_path = make_readable_path(path)
	if not os.path.isfile(path):
		logger.log(logger.red("Can't read pylpfile "), logger.magenta(readable_path))
		sys.exit(-1)
	else:
		logger.log("Using pylpfile ", logger.magenta(readable_path))


	# Run the pylpfile
	try:
		runpy.run_path(path, None, "pylpfile")
	except Exception as e:
		traceback.print_exc(file=sys.stdout)
		logger.log(logger.red("\nAn error has occurred during the execution of the pylpfile"))
		sys.exit(-1)


	# Start the tasks
	for name in tasks:
		pylp.start(name)

	# Wait until all task are executed
	loop = asyncio.get_event_loop()
	loop.run_until_complete(wait_and_quit(loop))
Run a pylpfile.