0

I have 2 scripts working together, one script receives the IP and port to connect to a server (more than one) and calls an client script, passing the ip and port to the main(ip,port) function on the client script but how can I call the client script AND pass the ip and port?

FEEDBACK:

#'pushd' dosn't work with os.system, you can use:

os.chdir('directory path')
os.system('python YourScriptName.py argument1 argument2')
Milteven
  • 31
  • 5
  • Please use the search feature for this: https://stackoverflow.com/questions/14892355/passing-arguments-into-os-system – Saelyth Nov 22 '17 at 16:39
  • Possible duplicate of [How to make a call to an executable from Python script?](https://stackoverflow.com/questions/2473655/how-to-make-a-call-to-an-executable-from-python-script) – ElmoVanKielmo Nov 22 '17 at 16:39
  • Not exactly working, I need to run the commands on cmd like this: 1) pushd C:\\MyScripts\\ 2)python userClient.py 127.0.0.1 1002 , how can I tell subproces.Popen or os.system to give an 'enter' before 2 and execute the second command? – Milteven Nov 22 '17 at 17:16

1 Answers1

0

FEEDBACK and Answer:

#'pushd' dosn't work with os.system, you can use:

os.chdir('directory path')
os.system('python YourScriptName.py argument1 argument2')
Milteven
  • 31
  • 5