diff --git a/main.py b/main.py index b4b6ac8..0536179 100644 --- a/main.py +++ b/main.py @@ -8,25 +8,25 @@ import cProfile import pstats from io import StringIO if __name__ == "__main__": - # 爬虫性能分析部分 - scawler = Scawler() - profiler = cProfile.Profile() - profiler.enable() - ls = scawler.work(1, 4) - danmu_counter = analyze_danmu_statistics(ls) - shower = Cloud_shower() - shower.to_show(danmu_counter) - - profiler.disable() - stream = StringIO() - stats = pstats.Stats(profiler, stream=stream) - stats.sort_stats('cumulative') # 按累计时间排序 - stats.print_stats(20) # 显示前20行 - print("\n=== 详细分析报告 ===") - print(stream.getvalue()) - #数据爬取部分 + # # 爬虫性能分析部分 # scawler = Scawler() - # ls = scawler.work(1, 40) + # profiler = cProfile.Profile() + # profiler.enable() + # ls = scawler.work(1, 4) + # danmu_counter = analyze_danmu_statistics(ls) + # shower = Cloud_shower() + # shower.to_show(danmu_counter) + + # profiler.disable() + # stream = StringIO() + # stats = pstats.Stats(profiler, stream=stream) + # stats.sort_stats('cumulative') # 按累计时间排序 + # stats.print_stats(20) # 显示前20行 + # print("\n=== 详细分析报告 ===") + # print(stream.getvalue()) + # 数据爬取部分 + scawler = Scawler() + ls = scawler.work(1, 40) # with open('./raw_danmu.txt', 'w', encoding='utf-8') as f: # for danmu in ls: # f.write(danmu + '\n') @@ -34,6 +34,6 @@ if __name__ == "__main__": # ls = [] # with open('./raw_danmu.txt', 'r', encoding='utf-8') as f: # ls = [line.strip() for line in f.readlines() if line.strip()] - # danmu_counter = analyze_danmu_statistics(ls) - # shower = Cloud_shower() - # shower.to_show(danmu_counter) + danmu_counter = analyze_danmu_statistics(ls) + shower = Cloud_shower() + shower.to_show(danmu_counter) diff --git a/tool/work2.code-workspace b/tool/work2.code-workspace deleted file mode 100644 index 8965ed5..0000000 --- a/tool/work2.code-workspace +++ /dev/null @@ -1,11 +0,0 @@ -{ - "folders": [ - { - "path": ".." - }, - { - "path": "../.." - } - ], - "settings": {} -} \ No newline at end of file