When trying to to import and execute a function within a Python module from a C++ executable, how can I pass in the directory where the module is located as a command line argument?
Python honors PYTHONPATH environmental variable. It is a PATH like environmental variable specifying paths where Python loads modules.
Inside .py script PYTHONPATH can be accessed and updated through the sys.path variable.
If you can show more source code how you create Python interpreter more helpful answer can be given.
specifiying directory of Python module when calling it from C++