Integrating Python script with Uipath

Hi all, I am trying to integrate Python script but getting error again n again…The Python script is working fine in Python and when I tried basic code with Uipath it worked but when I am trying to integrate required code , it is not working…getting error “Load python script faulted” …I am attaching my code along with sample file…

from docx import Document

sentences_file1=
sentences_Dict1={}
sentences_file2=
sentences_Dict2={}
def text_difference():
# df=pd.read_csv(‘file_1.docx’)
# print(df)
document_one = Document(r’C:\New file\File 1.docx’)
print(“df”,document_one.paragraphs)
i=1
for p in document_one.paragraphs:
# print(p.text)
sentences_file1.append(p.text)
sentences_Dict1[i]=p.text
i+=1
document_two = Document(r’C:\New file\File 2.docx’)
print(“df”,document_one.paragraphs)

j=1
for p in document_two.paragraphs:
    # print(p.text)
    sentences_file2.append(p.text)
    sentences_Dict2[j]=p.text
    j+=1

text_difference()

print(sentences_Dict1)

print(sentences_Dict1.items())
dict_key = sentences_Dict1.keys()
print(len(sentences_Dict1.keys()))
print(len(sentences_Dict2.keys()))

odd_sentences1={}
odd_sentences2={}
all_setences={}
def compare_lines(index,line_1,line_2):
# print(index,line_1,line_2)
if not line_1==line_2:
print(index,line_1,line_2)
return True
else:
pass

pass

def compare_dict(dict1,dict2):
if dict1 and dict2:
if len(sentences_Dict1.keys()) == len(sentences_Dict2.keys()):
print(“file are equal”)
for i in range(1,len(sentences_Dict2)+1):
if i<=len(sentences_Dict1):
if compare_lines(i,str(sentences_Dict1[i]),str(sentences_Dict2[i])):
odd_sentences1[i] = str(sentences_Dict1[i])
odd_sentences2[i] = str(sentences_Dict2[i])
pass

    elif len(sentences_Dict1.keys()) < len(sentences_Dict2.keys()):
        print("File one is smaller")
        for i in range(1,len(sentences_Dict2)+1):
            if i<=len(sentences_Dict1):
                # all_setences[i] = str(sentences_Dict1[i] + "------" + sentences_Dict2[i])
                if compare_lines(i,str(sentences_Dict1[i]),str(sentences_Dict2[i])):
                    odd_sentences1[i] = str(sentences_Dict2[i])
                    odd_sentences2[i] = str(sentences_Dict1[i])


            else:# all the element from hera are unique in file 2
                odd_sentences1[i] = str(sentences_Dict2[i])
                pass
        pass
    elif len(sentences_Dict1.keys()) > len(sentences_Dict2.keys()):
        print("File two is smaller")
        for i in range(1,len(sentences_Dict1)+1):
            if i<=len(sentences_Dict1):
                if compare_lines(i,str(sentences_Dict1[i]),str(sentences_Dict2[i])):
                    odd_sentences1[i] = str(sentences_Dict1[i])
                    odd_sentences2[i] = str(sentences_Dict2[i])
        pass
else:
    pass

compare_dict(sentences_Dict1,sentences_Dict2)
print(“large File”,odd_sentences1)
print(5*’\n’)
print(“small file”,odd_sentences2)

print(all_setences)1212.pdf (6.0 KB) 12121.pdf (6.7 KB)