Followers
0
Following
0
Joined
Last Online
-
eddo888
works better using python3
python2 is great but not perfect -
eddo888
two excellent modules to use are
- requests , to retrieve html content
- beautiful soup (bs4), to parse html content
you can load these with StaSh and use "pip install requests bs4"
-
eddo888
you can call pythonista from shortcuts and get a reply from pythonista,
here is a client pythonista app, put in the home folder in the "on the iphone" section
#!/usr/bin/env python # sys.args[0]=workflow.py import sys,json,urllib from datetime import datetime import console,webbrowser,clipboard def main(): console.clear() console.set_font('Menlo',12) console.set_color(1,1,1) #print json.dumps(sys.argv, indent=4) dtf = '%Y-%m-%d %H:%M:%S' output = dict( when=datetime.now().strftime(dtf), args=sys.argv ) result = json.dumps(output,indent=4) print(result) x_callback=sys.argv[-1] if not '://' in x_callback: return url = x_callback + '?argv=' + urllib.quote(result) webbrowser.open(url) if __name__ == '__main__': main()
here is the workflow,
x-callback-url = "pythonista://workflow.py?action=run&argv=1&argv=2"
note the change to the x-success parameter
"success key"=args -
eddo888
install StaSh and you can "pip install" a huge range of modules
https://forum.omz-software.com/topic/1919/stash-shell-like-an-expert-in-pythonista
-