Skip to content
Advertisement

Category: Questions

‘pdflatex’ not found in subprocess within a bundled PyInstaller APP

I am attempting to create a macOS standalone app from a PyQt5 GUI using PyInstaller. All works apart from automatically generating a PDF from a TEX file using the pdflatex module (in conjunction with Pylatex). Both the pylatex and pdflatex modules require calling the subprocess module, which is done as following: Where args=[‘pdflatex’, ‘-output-directory=/Users/Desktop’, ‘-interaction-mode=batchmode’, ‘-jobname=test’] This however does not

Incorrect password string gets entered by send_keys in selenium python

Somehow send_keys enters repeat password or string other than mentioned password leading login failure. Tried adding explicit wait(), driver.clear() but does not work. Here is a sample code in Python – Approach 1 – Here instead of “xyz” probably “xyzxyzxyzx” string gets added to the password field(cannot decode as password gets masked). Please suggest. Approach 2 – Also, another try

Mongo db array of images change schema

I have an array of images in mongodb and I am trying to change the schema of the array. Right now the images are stored like bellow And the final output I want is like bellow. How can I do this in mongosh? Is it easier to do this as a Python Array and then import back to mongodb? Thank

How to have an incomplete block in Python without error?

This is my code which logically throws error that needs indentation: elif platform == ‘win32’: IndentationError: expected an indented block I need Python to check if OS is whether Linux or Windows, open the file in home of that user and do the same code (in this case for loop) after detecting the OS. Is there a way to avoid

How to use patch.object() correctly

I’m trying to get my head around Mock and patch(), but I’m stuck on a somewhat simple example. Say I have the following function in main.py, which tests if it’s a weekday or not. I want to run my test with two possible outcomes: either False if I mock Saturday or Sunday or True if it’s a weekday. Now, I’m

for loop with zip in python

I want to use zip to iterate to existing Lists. I did that with the code below. Currently the output is just Name –> Name. How do I use the new creates list or if that’s not possible the other lists to print following sentence: “#NAME is #AGE years old, and they can be called at #NUMBER”. Is it possible

Advertisement