selfteaching / selfteaching/selfteaching-python-camp

Day11 关于vscode中 input()在Python interactive中运行出错的问题

Open
#2,287 2 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

使用input()运行时出现错误:StdinNotImplementedError: raw_input was called, but this frontend does not support input requests.
代码如下:
import yagmail
import getpass
sender = input('输入发件人邮箱:')
password = getpass.getpass('输入发件人邮箱密码:')
recipients = input('输入发件人邮箱:')
yag = yagmail.SMTP(sender,password,'smtp.qq.com')
contents = str(stats)
yag.send(recipients, '19100402 ZhengGuanya', contents)
已尝试input(("输入发件人邮箱:")) 和input("输入发件人邮箱:") 以及input((’输入发件人邮箱:’)) 等均未能运行成功。

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 provided Python script in VS Code's Python interactive environment, focusing on the input() and getpass.getpass() calls and the reported StdinNotImplementedError. Compare the behavior with the project's documented execution path; done means the supported interactive-input behavior or required workaround is verified and clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.