Passing argument to python script for blender through command line

Hi.

I am trying to run the python script for blender through the command line.
I know for that we need blender -P myFile.py.
But i also want to be able to give parameters of myFile as an input from the command line(For that i used argparse in myFile script).

I try for instance blender -P myFile.py -arg1 1 -arg2 2.
But command line can not differentiate -arg1 as an argument to myFile.py instead of blender.

Can you please help me with this issue?

Moved from “General Forums > Blender and CG Discussions” to “Coding > Python Support”

Thank you!