Mismatched input 'result expecting RPAREN: While running jython script

Rohit Jindal picture Rohit Jindal · Dec 12, 2012 · Viewed 8.5k times · Source

I have been trying to run a jython script which installs a package and opens a activity and then takes its screen shot and finally saves it in a File. I am using the following Code to do this:

    from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
device.installPackage('F:\jind\Example.apk')
package= 'com.android.example'
activity= 'com.android.example.main_activity'
runComponent= package + '/' + activity
device.startActivity(component=runComponent)
device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
result=device.takeSnapshot()
result.writeToFile('F:\jind\lk.png','png')

After running the script. writeToFile() is giving Error saying 'mismatched input 'result' expecting RPAREN

Thanks in Advance

Answer

Diego Torres Milano picture Diego Torres Milano · Dec 12, 2012

fix missing ')':

device.press()