当前位置: 首页>>代码示例>>Python>>正文


Python Interest.maxSuffixComponents方法代码示例

本文整理汇总了Python中pyndn.Interest.maxSuffixComponents方法的典型用法代码示例。如果您正苦于以下问题:Python Interest.maxSuffixComponents方法的具体用法?Python Interest.maxSuffixComponents怎么用?Python Interest.maxSuffixComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyndn.Interest的用法示例。


在下文中一共展示了Interest.maxSuffixComponents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Interest

# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import maxSuffixComponents [as 别名]
from pyndn import Interest, Name, Key, NDN, _pyndn
import datetime

k = NDN.getDefaultKey()

i = Interest()
i.name = Name('/hello/world')
i.minSuffixComponents = 2
i.maxSuffixComponents = 4
i.publisherPublicKeyDigest = k.publicKeyID
i.exclude = None
i.childSelector = 1
i.answerOriginKind = 4
i.scope = 2
i.interestLifetime = 30.0
i.nonce = b'abababa'

print(i)
print(i.ndn_data)

i2 = _pyndn.Interest_obj_from_ndn(i.ndn_data)
print(i2)

assert(i.name == i2.name)
assert(i.minSuffixComponents == i2.minSuffixComponents)
assert(i.maxSuffixComponents == i2.maxSuffixComponents)
assert(i.publisherPublicKeyDigest == i2.publisherPublicKeyDigest)
assert(i.exclude == i2.exclude)
assert(i.childSelector == i2.childSelector)
assert(i.scope == i2.scope)
assert(i.interestLifetime == i2.interestLifetime)
开发者ID:MAHIS,项目名称:PyNDN,代码行数:33,代码来源:interest.py


注:本文中的pyndn.Interest.maxSuffixComponents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。