本文整理汇总了Python中note.Note.set_xml_header方法的典型用法代码示例。如果您正苦于以下问题:Python Note.set_xml_header方法的具体用法?Python Note.set_xml_header怎么用?Python Note.set_xml_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类note.Note
的用法示例。
在下文中一共展示了Note.set_xml_header方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from note import Note [as 别名]
# 或者: from note.Note import set_xml_header [as 别名]
# Now, add the new Resource to the note's list of resources
note.resources = [resource]
# To display the Resource as part of the note's content, include an <en-media>
# tag in the note's ENML content. The en-media tag identifies the corresponding
# Resource using the MD5 hash.
hash_hex = binascii.hexlify(hash)
hash_str = hash_hex.decode("UTF-8")
# The content of an Evernote note is represented using Evernote Markup Language
# (ENML). The full ENML specification can be found in the Evernote API Overview
# at http://dev.evernote.com/documentation/cloud/chapters/ENML.php
# Sample note content
# note.content = '<?xml version="1.0" encoding="UTF-8"?>'
# note.content += '<!DOCTYPE en-note SYSTEM ' \
# '"http://xml.evernote.com/pub/enml2.dtd">'
# note.content += '<en-note>Here is the Evernote logo:<br/>'
# note.content += '<en-media type="image/png" hash="{}"/>'.format(hash_str)
# note.content += '</en-note>'
note.content = notes.set_xml_header('Hello Evernote')
# Finally, send the new note to Evernote using the createNote method
# The new Note object that is returned will contain server-generated
# attributes such as the new note's unique GUID.
# created_note = note_store.createNote(note)
created_note = notes.create_note(note_store, note)
print("Successfully created a new note with GUID: ", created_note.guid)