0

Problem: Unable to call squish functions in Python modules. Imported squish & added squish. in front of its function but doesn't seem to work.

test.py

import gAPI 

screenshot(obj, filename) 

gAPI.py

import squish 

def screenshot(obj, file): 
    widget = squish.waitForObject(obj) 
    img = squish.grabWidget(widget) 
    img.squish.save(file,"PNG") 
return img 

When this is ran in Python modules it returns the error "QPixmap" Squish object has no attribute "squish". Wonder if anyone knows how to resolve this.

1 Answer 1

0

As far as I can tell it should be...

img.save(file,"PNG")

...instead.

The fact that the QPixmap type is located in module "squish" does not mean that ".squish" needs to be added to calls of its methods/functions. So this works the same as for any other Python type.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.