TypeError:' _io.TextIOWrapper'对象不可调用,创建文本文件错误

时间:2015-10-29 17:45:40

标签: python error-handling

    list = [Blarg, T2, T3]
    Rewrite(List)


    def Rewrite(New2):
        List_Length = len(New2)
        L = 0
        with open('Chronologiser2.BCF', 'w') as file_output:
            file_output('')

        while L < List_Length:
            with open('Chronologiser2.BCF', 'a') as file_output:
                Current_Text = New2[L]
                file_output(str(Current_Text) + '/n')
                L += 1

有人可以向我解释为什么我会继续得到&#39; TypeError:&#39; _io.TextIOWrapper&#39;对象不可调用&#39;错误,我摧毁了我的大脑,看了同样的问题,但仍然没有什么

1 个答案:

答案 0 :(得分:5)

您需要调用 [self presentViewController: alertController animated: YES completion:^{ alertController.view.superview.userInteractionEnabled = YES; [alertController.view.superview addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(alertControllerBackgroundTapped)]]; }]; - (void)alertControllerBackgroundTapped { [self dismissViewControllerAnimated: YES completion: nil]; } 的{​​{1}}方法,而不是直接调用它:

write