I have taken the setup variable as
setup='''import subprocess \
from java_compile import func
'''
Definition of function whose time i want to measure is:
def func(uid,ppid,j,fn):
global fwrite
curr_working_path=os.getcwd()
rel_path='/var/www/html/abc/temp/'+uid+'/p'+str(ppid)+'/'
os.chdir(rel_path)
fdr=open(fwrite,"r")
fdw=open(str(j)+'.txt',"w")
subprocess.call(['java',str(fn)],stdin=fdr,stdout=fdw,stderr=subprocess.STDOUT)
os.chdir(curr_working_path)
And i am calling the timeit functiont
timeit.timeit("func("+uid+","+str(ppid)+","+str(j)+","+fn+")",setup,number=1))
Also java_compile is the file which has two function one check and other one is func. In func check i am calling timeit module to calculate the time for execution of function func. When it tried to debug it i found that it is taking a new line character at the end of setup variable or in the statement, i am unable to understand why such thing is happening?Please help