File tree Expand file tree Collapse file tree 3 files changed +16
-132
lines changed Expand file tree Collapse file tree 3 files changed +16
-132
lines changed Original file line number Diff line number Diff line change @@ -246,12 +246,26 @@ def generate_summary():
246246 with open ('./summary_en.md' , 'w' , encoding = 'utf-8' ) as f :
247247 f .write (summary_en )
248248
249+ @staticmethod
250+ def remove_empty_folders ():
251+ """remove empty sub folders"""
252+ sub_folders = [str (i * 100 ).zfill (4 ) + '-' + str (i * 100 + 99 ).zfill (4 ) for i in range (100 )]
253+
254+ for item in sub_folders :
255+ if not os .path .isdir (f'./{ item } ' ):
256+ continue
257+ files = os .listdir (f'./{ item } ' )
258+ for f in files :
259+ if os .path .isdir (f'./{ item } /{ f } ' ):
260+ if not os .listdir (f'./{ item } /{ f } ' ):
261+ os .rmdir (f'./{ item } /{ f } ' )
262+
249263
250264if __name__ == '__main__' :
251265 spider = LCSpider ()
252266
253- spider .get_all_questions ()
254- spider .save_result ()
267+ # spider.get_all_questions()
268+ # spider.save_result()
255269
256270 spider .generate_readme ()
257271 spider .generate_question_readme ()
You can’t perform that action at this time.
0 commit comments