2

I have a python script for concatenate strings. You can find the code below. I have converted this .py file to exe.

Concat.exe - Code

import sys

def concat_name(firstname, secondname):
    fullname = firstname + ' ' + secondname
    return fullname


fullname = (concat_name(sys.argv[1], sys.argv[2]))

When I am executing the .exe file in the command prompt, getting the expected result.

>concat.exe Juan Carlos
Juan Carlos

Concat.exe - execution Now I have another Python script generate_name.py, and this script calling the concate.exe with relevant params. Please find the below code,

import sys
import subprocess

full_name = subprocess.check_output(['concat.exe', 'Juan' , 'Carlos'])
print(full_name)

generate_name.py - code

But here I can not retrieve and print the output from the concat.exe. So can anyone help out on this issue?

Thanks in Advance, Raj

Sunesh M
  • 31
  • 3

0 Answers0