I run this function to make moving files finish before other script lines are read. When I move video files subprocess.call moves and plays the video.
I what to avoid playing. How can I do that. There is an option to send output to NULL. stdout=subprocess.DEVNULL. But it did not help.
def move_files_while_script_waits(src, dest):
try:
for a_file in os.listdir(src):
old_place = os.path.join(src, a_file)
new_place = os.path.join(dest, a_file)
subprocess.call(shutil.move(old_place, new_place),shell=True)
except Exception as e:
print(e)