Widget and requests module
I was trying to check whether it is possible to use the requests module in widget but somehow the widget displays an error saying that there was an error loading the widget.
I though the problem was with my widget but I get the same error if I add the module requests to then widget example Launcher that comes with pythonista.
Is this not supported?
To overcome this problem I was trying to run a script called from the widget itself (that use the requests module). Does anyone knows how to do it without using 'webbrowser.open' which opens pythonista in the foreground?
@djorge webbrowser is not allowed in appex mode, try, instead of webbrowser.open
def button_action(self, sender): #import webbrowser #webbrowser.open(sender.name) from objc_util import UIApplication,nsurl app=UIApplication.sharedApplication() urlapp = nsurl(sender.name) app.openURL_(urlapp)
where I've tried 'pythonisyta3://script_name?action=run' and it is ok but it also starts Pythonista
Thats weird. I'm importing appear and using webbrowser.open with that URL and it doesn't complain.