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

运行报错 #9

Closed
hahahawin opened this issue Mar 28, 2021 · 5 comments
Closed

运行报错 #9

hahahawin opened this issue Mar 28, 2021 · 5 comments

Comments

@hahahawin
Copy link

image

@wxy1343
Copy link
Owner

wxy1343 commented Mar 28, 2021

更新下python版本试试

@wxy1343 wxy1343 closed this as completed Mar 29, 2021
@imldy
Copy link

imldy commented Mar 30, 2021

更新下python版本试试

你好,需要哪个版本……麻烦明确说一下

@imldy
Copy link

imldy commented Mar 30, 2021

更新下python版本试试

你好,需要哪个版本……麻烦明确说一下

python3.7可用

@wxy1343
Copy link
Owner

wxy1343 commented Mar 30, 2021

更新下python版本试试

你好,需要哪个版本……麻烦明确说一下

https://docs.python.org/3.7/library/collections.html#collections.namedtuple
由于namedtuple的default参数在3.7才加入,所以低于3.7的可以手动修改代码

FileInfo = namedtuple('FileInfo', _file_info, defaults=('',) * len(_file_info))
UserInfo = namedtuple('UserInfo', ['id', 'nick_name', 'ctime', 'phone', 'drive_id'], defaults=('',) * 5)

变成

FileInfo = namedtuple('FileInfo', _file_info)
FileInfo.__new__.__defaults__ = ('',) * len(_file_info)
UserInfo = namedtuple('UserInfo', ['id', 'nick_name', 'ctime', 'phone', 'drive_id'])
UserInfo.__new__.__defaults__ = ('',) * 5

@imldy
Copy link

imldy commented Mar 30, 2021

@wxy1343 好的,谢谢,感谢回复

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

3 participants