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

代码段设置可以换行不知道怎么解决(python是要求缩进的,一换行就错了) #143

Open
goodcode-200 opened this issue Apr 5, 2019 · 1 comment

Comments

@goodcode-200
Copy link

图片
这样代码一换行就错了,看起来很扎眼。没有了美感,博主快把主题中代码段换回默认的呀

还有
图片
这个文本段可以有换行的,不然,读起来不方便

def main():
    print("正在创建对象列表,请等待...........")
    obj_list = Search_each_Per()
                                                        #下面对结果按发表次数做降序处理
    print("下面对结果按发表次数做降序处理...")
    obj_list.sort(key = lambda obj:obj.times,reverse = True)
    # 将结果写入text文本中
    print("将结果写入text文本中,请耐心等待...")
    path = os.getcwd()
    filename = path + "读者作者结果2.txt"
    new = open(filename,"w",errors="ignore")         #处理非法字符  illegal multibyte sequence
    for i in obj_list:
        author = i.name
        times = i.times
        print(author)
        print(times)
        if author == None:
            new.write("None" +"\t" + str(times) + "\n")
        else:
            new.write(author +"\t" + str(times) + "\n")
    new.close()
    print("完成统计")

这样是正常的,换手机屏幕尺寸也合适
图片

@goodcode-200
Copy link
Author

博主可不可以告诉我在哪里可以更改?我太菜了,找不到,哈哈

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

1 participant