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.
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.
might, white space, or entering new lines is will cause issue and please function names are defined correctly
Please check the below link for your reference
https://automationanywhere.wistia.com/medias/euyjjrfno4
fallow the solution and video mentioned by @Tamil Arasu10 (Customer) , even after it didnt resolved before running the bot please preload the python package in the packages section
Hi @Niraj Kumar have you solved the issue?I'm also facing same issue..even basic python code is also not working.It's stucks at the execution step.
@Abin Jilson yes,
Check your environment variable and put your code inside py script folder.
If your script is outside py script folder it won't return or execute the code.
Hi,
You can reach out to me, i can be able to help for the python code and integrate well with AA and A360.
Hi
Can you help me with below code.
It is working in VS studio but in AA it is throwing Bot error.
Hi Ashish,
Please share the code and the file that you are using in the code.
Also i found that f is missing from the code “from PyPDF2 import PdfReader, PdfWriter.
Hi
Please find the code below.
def PDFCom():
from PyPDF2 import PdfReader,PdfWriter
try:
Input= 'C:\\Users\\aitware\\Desktop\\Ashish Code\\133100.pdf'
Output= 'C:\\Users\\aitware\\Desktop\\Ashish Code\\Out.pdf'
reader = PdfReader(Input)
writer = PdfWriter()
count= len(reader.pages)
for page in reader.pages:
page.compress_content_streams()
writer.add_page(page)
with open(Output, "wb") as f:
writer.write(f)
except Exception as e: print(e)
Hi AshishItWare,
If possible for you to share the pdf file that would be great as well.
I can test the code and will update you soon after getting the file.
Hi
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.
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.
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
Hi
Thank you for your help.
While running python in AA Im getting error like this ,How can I solve this issue?
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?
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
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.