python 从Bookmarklet.py导入Pythonista脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 从Bookmarklet.py导入Pythonista脚本相关的知识,希望对你有一定的参考价值。

# Posted at http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet
# Script Name: Import Pythonista Script from Bookmarklet

# I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1
# I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
# I got help from here: http://www.macstories.net/tutorials/from-instapaper-and-pythonista-to-dropbox-and-evernote-as-pdf/

import sys
import urllib2
import editor
import os

url = sys.argv[1]
scriptName = os.path.basename(url)
contents = urllib2.urlopen(url).read()
editor.make_new_file(scriptName[:-3], contents)

以上是关于python 从Bookmarklet.py导入Pythonista脚本的主要内容,如果未能解决你的问题,请参考以下文章

Python:导入包含的包

我无法从 Selenium 导入密钥

如何在python3中正确导入同一目录下的模块

访问 python 子列表以导入 pandas DataFrame

python3绝对路径,相对路径

如何从我从cli导入的Login.keychain中删除.p12文件?