DrAllen
DrAllen
2021-01-28 14:16

为什么会报错呀?该怎么修改?

  • python
#!--*--coding:utf8--*--
from 练习.file import r_file, file
from 练习.login import login
from 练习.loginuser import login_name


def call():
    if login_name in r_file():
        login()
    else:
        print('该用户未注册,是否去注册?'
               'y,去注册')
        choose = input('请输入你的选择>>>:')
        if choose == 'y':
             ret = file()
        else:
            login()
    return login_name


if __name__ == '__main__':
    call()
请输入用户名>>>>:123

Traceback (most recent call last):
  File "D:/Program/小游戏/练习/main.py", line 22, in <module>
    call()
  File "D:/Program/小游戏/练习/main.py", line 8, in call
    if login_name in r_file():
  File "D:\Program\小游戏\练习\file.py", line 16, in r_file
    for user in f.readlines():
io.UnsupportedOperation: not readable

进程已结束,退出代码 1
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答