selfteaching / selfteaching/selfteaching-python-camp

Day12 无法给好友回复结果

Open
#2,325 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
151
Forks
875
PR merge metrics
No merged PRs in 30d

Description

当好友给分享文章时,能够统计分词后的词频结果,但是无法回复给好友,代码如下:

from mymodule import stats_word
import requests
from pyquery import PyQuery
from wxpy import *

bot=Bot()
my_friend=bot.friends()

@bot.register(my_friend, msg_types=SHARING)
def reply_my_friend(msg):
    response=requests.get(msg.url)
    document=PyQuery(response.text)
    content=document('#js_content').text()
    reply=print(stats_word.stats_text_cn(content,100))
    return reply
       
embed()

还有就是运行代码的时候,只有第一次才能成功运行,一旦运行第二次,则显示SyntaxError: invalid syntax,重启后可成功运行。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two reported failures from the Python snippet: replying to a shared article and running the code a second time. Check that a successful run sends the word-frequency result to the friend and that repeated execution no longer raises SyntaxError; no repository file or test is identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.