selfteaching / selfteaching/selfteaching-python-camp
Day12 无法给好友回复结果
Open
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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