Skip to main content
typo
Source Link
Maciej Kucharz
  • 1.4k
  • 1
  • 14
  • 17

I have external script (sh), i would like to do something like this:

arg1 = 'some string'
arg2 = 'some string2'
arg3 = ''

cmd = ['/usr/local/bin/myscript', 'arg1', 'arg2', 'arg3']
Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)

I seamsseems, that if "arg3" is empty, my script i called only with two arguments, how can I pass "arg3" event if it's empty?

I have external script (sh), i would like to do something like this:

arg1 = 'some string'
arg2 = 'some string2'
arg3 = ''

cmd = ['/usr/local/bin/myscript', 'arg1', 'arg2', 'arg3']
Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)

I seams, that if "arg3" is empty, my script i called only with two arguments, how can I pass "arg3" event if it's empty?

I have external script (sh), i would like to do something like this:

arg1 = 'some string'
arg2 = 'some string2'
arg3 = ''

cmd = ['/usr/local/bin/myscript', 'arg1', 'arg2', 'arg3']
Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)

I seems, that if "arg3" is empty, my script i called only with two arguments, how can I pass "arg3" event if it's empty?

Source Link
Maciej Kucharz
  • 1.4k
  • 1
  • 14
  • 17

How to pass empty argument to Popen (with shell=False)?

I have external script (sh), i would like to do something like this:

arg1 = 'some string'
arg2 = 'some string2'
arg3 = ''

cmd = ['/usr/local/bin/myscript', 'arg1', 'arg2', 'arg3']
Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)

I seams, that if "arg3" is empty, my script i called only with two arguments, how can I pass "arg3" event if it's empty?