Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #42

Closed
RuoyuDeng opened this issue Feb 9, 2021 · 10 comments
Closed

IndexError: list index out of range #42

RuoyuDeng opened this issue Feb 9, 2021 · 10 comments

Comments

@RuoyuDeng
Copy link

RuoyuDeng commented Feb 9, 2021

Hi,

I do not know why no matter what SSID I put in as input, it keeps saying IndexError for some reason.
image

my OS is Windows 10
my python version is 3.9.0
my wifi-password version is 1.0.9

@lixiaoyi01
Copy link

win10 要用gbk解析,并且获取得密码串需要改一下正则 re.findall(r"Key Content\s+:\s(.)", password) =>re.findall(r"关键内容\s+:\s(.)", password)

@RuoyuDeng
Copy link
Author

请教一下,gbk解析是什么意思呢?是在cmd里执行的吗?

@lixiaoyi01
Copy link

1、
image
2、
image
需要修改这两块、我没有权限修改。

@RuoyuDeng
Copy link
Author

你好,我根据你的代码改了之后
1.
image

image
在原安装路径下执行python setup.py install重新依据新的wifi_password.py文件再次安装后,问题仍然存在:
image
请问可能是什么原因呢?

@sunrabbit123
Copy link

Enter the following syntax into the window shell.

netsh wlan show profiles name="SSID" key=clear

And please check what Key Contents has been translated into.

And replace it.

This is covered in #39.

@RuoyuDeng
Copy link
Author

Hi, I think I am a bit lost when you said: "replace it". This might sound stupid but where should I replace what to what exactly?

@sunrabbit123
Copy link

this is example code

elif platform == constants.WINDOWS:
                password = Utils.run_command(
                    f'netsh wlan show profile name="{ssid}" key=clear | findstr Key'
                )

                if password != "":
                    password = re.findall(r"Key Content\s+:\s(.*)", password)[0]

you can find it(Key Content, Key)

@RuoyuDeng
Copy link
Author

I have figured out why it happened. Since my computer is in Chinese, so I have to change the "Key" in
f'netsh wlan show profile name="{ssid}" key=clear | findstr Key' to Chinese, which is "关键内容“. Now it works pefectly.

@survivor-zxc
Copy link

仅仅针对Windows10,我修改了下wifi_password.py文件。自己测试是成功的,有兴趣你可以用文件对比工具对比下修改的内容。
文件地址在这里:https://note.youdao.com/ynoteshare1/index.html?id=d130d9fdb160e98a44e7032cddd2881b&type=note

@sdushantha
Copy link
Owner

This is happening due to language issues. Thanks to @celianvdb, it has been fixed in 72b299d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants