【发布时间】:2016-05-16 00:01:30
【问题描述】:
从 javascript (enml.js) 移植 enml 库
evernote-sdk-js 的 ENML.PlainTextOfENML 对我有用
我想为 Python 找到这个工具的一个很好的端口。
我尝试使用这些库,但出现错误:
https://github.com/CarlLee/ENML_PY
ImportError: 没有名为 bs4 的模块
https://github.com/wanasit/enml-py
2013 年 2 月,没有文件,
ImportError: No module named internals
例如
我想得到:
任何对 Apple 产品的液体损坏都会使您的保修失效。
来自
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note>any sort of liquid damage to an Apple product will void your warranty.</en-note>
我要使用 enml 的代码部分:
视图.py
title_contents = {}
for note in result_list.notes:
content = note_store.getNoteContent(auth_token,
note_store.getNote(note.guid,
True,False, False, False).guid)
title_contents[note.title] = content
enter code herereturn render_to_response('oauth/callback.html', {'notebooks': notebooks,
'result_list': result_list,
'title_contents': title_contents})
回调.html
.....
<ul>
{% for title, content in title_contents.items %}
<li><b>{{ title }}</b><br>{{ content }}</li>
{% endfor %}
</ul>
【问题讨论】:
-
我以前从未使用过它,但是这些导入错误是由于您没有安装它们的依赖项
bs4: stackoverflow.com/questions/11783875/… 和NLTKstackoverflow.com/questions/24653957/… -
谢谢,第一个链接对我有帮助。