This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python2 | |
"""encodes a StaSh command to a pythonista3 URL-scheme.""" | |
# If you dont know what StaSh is, check it out: | |
# https://www.github.com/ywangd/stash/ | |
# This script requires a feature which will soon be included in a pull-request | |
# (and hopefully be accepted) | |
import urllib | |
import clipboard | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
check if an ip address or hostname is local. | |
NOTE: IPv6 support is NOT 100% tested. Some IPv6 addresses seem to work, others not. | |
""" | |
import socket | |
def host_is_local(hostname, port=None): | |
"""returns True if the hostname points to the localhost, otherwise False.""" | |
if port is None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Open an URL on pc. | |
You need to configure pythonista to run this script when "open in" is used. | |
Replace YOUR_HOST_OR_IP with your ip or hostname. | |
""" | |
#!python2 | |
import socket | |
import appex | |
HOST = "YOUR_HOST_OR_IP" # host/IP to connect to |