Creating a Trojan By Embedding Files In Program Code, getting error

Hi. I’m getting an error when trying to run an executable. I tried the --add-file command to make a Trojan but I keep getting an error. My code is a bit different as some I want to save the location of the file to the Public folder

Not sure what the error is in the code. Which course and lecture this code is from?

Zaids Learn Python & Ethical Hacking From Scratch, Section 15: Writing Malware - Packaging, video 6

The code looks fine. Maybe the pdf file that you are trying to open is corrupted. Try putting some other file to open. Also in --add-data you have specified the file location and the directory - check if that is correct