今天写个ping vpn的python脚本,报错IndexError: list index out of range 最后查看是python读取文件中出现空格 去掉空格即可…
pyinstaller将py打包为exe文件,用pysintaller居然报错 File "c:\anaconda3\lib\site-packages\PyInstaller\depend\utils.py", line 226, in __scan_code_instruction_for_ctypes name = co.co_names[oparg] IndexError: tuple index out of range 1 2 3 搜索了一番,用群众神奇的方式 找到D:\p…
报错现象 xadmin 集成到项目后进行添加数据的时候报错 具体如下 黄页 后端 具体报错定位 报错分析 点击这里 报错解决 源码 input_html = [ht for ht in super(AdminSplitDateTime, self).render(name, value, attrs).split('\n') if ht != ''] 修改后 input_html = [ht for ht in super(AdminSplitDateTime, self).render(nam…
用python写脚本查询字典时,在遍历字典时循环到某一项时老是报错   出现这种错误有两种情况: 第1种可能情况 list[index]index超出范围 第2种可能情况 list是空值就会出现 IndexError: list index out of range 第二种情况尤为难以排除错误…
今天第一次发随笔还有许多不足之处,欢迎评论!!! 最近在写一个成语接龙的小游戏,结果在数组添加元素时报错:IndexError: list index out of range 源码: import pypinyin robot=[""] #机器回答的成语列表(先不加成语) robotpy1=[] #机器回答成语列表的所有成语的第一个拼音 for k in robot:#便利 robotpy1.append(pypinyin.pinyin(k, style=pypinyin.NORMA…
python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte sequence 示例代码: fileName = 'E:/2/采集数据_pswf12_180大0小35750_20181206.txt' currentFile = open(fileName) content = currentFile.read() print(content) 报错原因: 要…
python安装tensorflow报错:python No matching distribution found for tensorflow==1.12.0 python版本是3.7.2 要安装的tensorflow版本是1.12.0 pip版本是18.1 安装操作是在pycharm上进行操作的. 但是一安装就报错:python No matching distribution found for tensorflow==1.12.0 解决办法: 将python进行退版本,也就是卸载当前这…
1.在查询时加了->select();如下,要加上order_id,即关联的字段(比如:order_id)比如要在select中,否则会报错:undefined index order_id //查询客户与他们的订单和国家 CustomerModel::find()->select('order_id')->with('orders', 'country')->all();…
1.mac下python环境pip报错: issuserdeMacBook-Pro:~ issuser$ pip install pyinstallerCollecting pyinstaller  Could not fetch URL https://pypi.python.org/simple/pyinstaller/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSIO…
Django中修改DATABASES后,执行python manage.py ****报错!UnicodeEncodeError: 'latin-1' codec can't encode character '\u2028' in position 9:ordinal not in range(256). 为了这个错误找了无数网页,花费数小时,结果在于配置的用户名密码是从微信电脑端上面复制过来的,里面有个分隔符(‘\u2028’),愚蠢的人类终于被自己蠢哭了!!! 解决方案:老老实实自己输入,…