Okay, that should be easy! As you say, a dos .exe has a header on it. A dos .com file does not... but is expected to be loaded at offset 100h. We have to tell Nasm that - "org 100h" - and we have to specify we want the ".com" name. Nasm's defaults, if you just did "nasm pyprog.asm" would be a file named "myprog", assembled at "org 0" - exactly what you want! I would suggest that you specify "org 0", and probably "-o myfile.bin", but just "for clarity".
Nasm pretends not to know what OS it's running on, or targetting code for. Kind of a PITA for folks who *want* dos files, or Windows files, or whatever, but it's perfect for what you want. "-f bin" will emit exactly the code you write, with no "red tape" at all.
Best,
Frank