I have a python "client.py" script as follows:
import sys
import traceback
import client_new
import subprocess
def main():
print "inside client"
subprocess.Popen('C:/client_new.py',shell=True)
#execfile('client_new.py')
if __name__ == "__main__":
is_sys_exit = False
ret_val = 0
try:
ret_val = main()
except SystemExit:
is_sys_exit = True
except:
if not is_sys_exit:
print( traceback.format_exc() )
if sys.version_info < ( 3,0 ):
raw_input( "Press return to continue" )
else:
input( "Press return to continue" )
sys.exit( 1 )
if is_sys_exit:
print( "SystemExit Exception was caught." )
sys.exit( ret_val )
The client_new.py script is as follows :
import traceback
def main():
print "inside client new"
if __name__ == "__main__":
is_sys_exit = False
ret_val = 0
try:
ret_val = main()
except SystemExit:
is_sys_exit = True
except:
if not is_sys_exit:
print( traceback.format_exc() )
if sys.version_info < ( 3,0 ):
raw_input( "Press return to continue" )
else:
input( "Press return to continue" )
sys.exit( 1 )
if is_sys_exit:
print( "SystemExit Exception was caught." )
sys.exit( ret_val )
so, from client.py there is another script client_new.py being called using subprocess but when the client.py is executed it only prints its data and does not displays the print of client_new. Hence, i am not getting what am i doing wrong with the call of client_new.py. Please help what am i missing.