本文整理汇总了Python中okcupyd.User.get_profile方法的典型用法代码示例。如果您正苦于以下问题:Python User.get_profile方法的具体用法?Python User.get_profile怎么用?Python User.get_profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类okcupyd.User
的用法示例。
在下文中一共展示了User.get_profile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: answer_all_their_questions
# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import get_profile [as 别名]
def answer_all_their_questions(username):
user = User()
them = user.get_profile(username)
for question in them.questions:
if not question.answered:
user.questions.respond(question.id, [1], [1], 3)
questions = them.question_fetchable()[:]
print len(questions)
question_id_to_question = {question.id: question
for question in user.profile.questions}
user.questions.clear()
time.sleep(10)
for question in questions:
user.questions.respond_from_question(question,
question_id_to_question, 3)