It’s just a proof of concept.
This is Dynamo graph
This is Python code in Dynamo:
import clr
import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
import os
arg = IN[0]
os.system('python z:\external_script.py ' + arg)
You can also use subprocess for more control.
And this is external_script.py:
import sys
print(sys.version)
print('Number of arguments:', len(sys.argv), 'arguments.')
print('Argument List:', str(sys.argv))
input('Press Enter to continue...')
This is the outcome: