Skip to main content
Cadet | Tier 2
January 26, 2022
Question

My Python code is not working

  • January 26, 2022
  • 17 replies
  • 1602 views

Hi,

I have a python code , while executing the python i am getting the correct output.

but at same time when i am calling the same python code through AA 360(V23), its stuck on execution steps. BoT is not retuning any error or output.

17 replies

Navigator | Tier 3
February 17, 2023

Hi @patelmaulesh ,

 

I cannot share that file you can try with any pdf file.

This is the code to reduce the file size please try with any pdf file.

Thank you.

 

Automation Anywhere Team
February 20, 2023

Hi AshishItWare,

 

I am checking with the code and while checking it also find some useful you tube link that can be useful to you.

 

 

Automation Anywhere Team
February 20, 2023

Hi AshishITware,
 

Here is the code that help to compress the file size.

 

from pypdf import PdfReader, PdfWriter

reader = PdfReader("C:\\test\\InvoiceSimple.pdf")
writer = PdfWriter()

for page in reader.pages:
    page.compress_content_streams()  # This is CPU intensive!
    writer.add_page(page)

with open("C:\\test\\InvoiceSimple11.pdf", "wb") as f:
    writer.write(f)

Also go through the given below GitHub link for further details:-

https://github.com/py-pdf/pypdf/issues/1546

Navigator | Tier 3
February 20, 2023

Hi @patelmaulesh ,

 

Thank you for your help.

 

Cadet | Tier 2
May 11, 2023

While running python in AA Im getting error like this ,How can I solve this issue?

Navigator | Tier 3
May 11, 2023

Check your code it maybe due to some formatting issue code don't work if we have extra space or misplaced any python line.

Did you install required Libraries in machine?

Cadet | Tier 2
May 31, 2023

Hi Team,

I am getting infinity running of script for this simple statement, Please help me in this scenario.

i have used sample number as number input and python_Output as any type ouput varaible