From 5d691e3200681989f51d738e0e95aac7bf051872 Mon Sep 17 00:00:00 2001 From: qq_44193969 <2608882093@qq.com> Date: Mon, 27 Dec 2021 16:47:24 +0800 Subject: [PATCH] modify ignore --- .gitignore | 8 +- data/book_mapping.json | 7 - .../code_1.java" | 16 - .../code_1.java" | 22 -- .../code_2.java" | 18 - .../code_3.java" | 4 - .../code_4.java" | 27 -- .../code_5.java" | 7 - ...\345\270\210\350\207\252\351\200\232.json" | 349 ------------------ helper.py | 147 -------- main.py | 4 - src/ebook/ebook_get_request.py | 44 --- src/ebook/extract_book_code.py | 118 ------ src/ebook/get_book_chapter_id_list.py | 18 - src/extract/__init__.py | 0 src/extract/extract_e_book_structure.py | 95 ----- src/extract/get_book_content.py | 25 -- src/tree.py | 296 --------------- 18 files changed, 6 insertions(+), 1199 deletions(-) delete mode 100644 data/book_mapping.json delete mode 100644 "data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25402\347\253\240 \345\205\250\347\250\213\346\265\213\350\257\225\357\274\232\351\227\252\345\205\211\347\232\204\346\200\235\346\203\263/2.2 \346\265\213\350\257\225\351\251\261\345\212\250\345\274\200\345\217\221/code_1.java" delete mode 100644 "data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_1.java" delete mode 100644 "data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_2.java" delete mode 100644 "data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_3.java" delete mode 100644 "data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_4.java" delete mode 100644 "data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_5.java" delete mode 100644 "data/topic_mapping/1.Python\347\274\226\347\250\213\346\227\240\345\270\210\350\207\252\351\200\232.json" delete mode 100644 helper.py delete mode 100644 main.py delete mode 100644 src/ebook/ebook_get_request.py delete mode 100644 src/ebook/extract_book_code.py delete mode 100644 src/ebook/get_book_chapter_id_list.py delete mode 100644 src/extract/__init__.py delete mode 100644 src/extract/extract_e_book_structure.py delete mode 100644 src/extract/get_book_content.py delete mode 100644 src/tree.py diff --git a/.gitignore b/.gitignore index 313613d..4a59da4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,10 @@ test.md data_backup test_dir test.html -src +/src/*/ +./src/*/ helper.py -main.py \ No newline at end of file +main.py +src +data/book_mapping.json +data/topic_mapping/1.Python编程无师自通.json diff --git a/data/book_mapping.json b/data/book_mapping.json deleted file mode 100644 index a099bc9..0000000 --- a/data/book_mapping.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Python编程无师自通": "c798a5992a654857867ec15660e1c32a", - "全程软件测试(第3版)": "825acb73c85c4c4bb9632afe858bc097", - "深入剖析Nginx": "608fd0c7025a4a34a97a29897b067d24", - "前端体验设计——HTML5+CSS3终极修炼": "c4eeb42b07f54b42a9fd1568b8ec4b98", - "零基础学机器学习": "b88b00f6ad14402ea66695d6809614da" -} \ No newline at end of file diff --git "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25402\347\253\240 \345\205\250\347\250\213\346\265\213\350\257\225\357\274\232\351\227\252\345\205\211\347\232\204\346\200\235\346\203\263/2.2 \346\265\213\350\257\225\351\251\261\345\212\250\345\274\200\345\217\221/code_1.java" "b/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25402\347\253\240 \345\205\250\347\250\213\346\265\213\350\257\225\357\274\232\351\227\252\345\205\211\347\232\204\346\200\235\346\203\263/2.2 \346\265\213\350\257\225\351\251\261\345\212\250\345\274\200\345\217\221/code_1.java" deleted file mode 100644 index d1ef820..0000000 --- "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25402\347\253\240 \345\205\250\347\250\213\346\265\213\350\257\225\357\274\232\351\227\252\345\205\211\347\232\204\346\200\235\346\203\263/2.2 \346\265\213\350\257\225\351\251\261\345\212\250\345\274\200\345\217\221/code_1.java" +++ /dev/null @@ -1,16 +0,0 @@ -Title (one line describing the story) -Narrative: -As a [role] -I want [feature] -So that [benefit] - -Acceptance criteria: (presented as Scenarios) - -Scenario 1: Title -Given [context] - And [some more context]... -When [event] -Then [outcome] - And [another outcome]... - -Scenario 2: ... \ No newline at end of file diff --git "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_1.java" "b/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_1.java" deleted file mode 100644 index 46529c0..0000000 --- "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_1.java" +++ /dev/null @@ -1,22 +0,0 @@ -public static void main(String[] args) { - // 首先创建一个 FireFox 浏览器webdriver的实例,并让浏览器访问必应 - WebDriver driver = new FirefoxDriver(); - driver.get("http://cn.bing.com"); -// 获取页面的 title - System.out.println("Home Page title: " + driver.getTitle()); - // 通过id找到input的web UI元素,并在此域内输入“软件测试”,并提交 - WebElement element = driver.findElement(By.id("sb_form_q")); -// 或通过xPath来定位web元素 -// element = driver.findElement(By.xpath("*[@id='sb_form_q']")) - // 在此域内输入“软件测试”,并提交 -element.sendKeys(“软件测试”); - element.submit(); - // 通过判断 title 内容等待搜索页面加载完毕 - (new WebDriverWait(driver, 10)).until(new ExpectedCondition() { - public Boolean apply(WebDriver d) { - return d.getTitle().toLowerCase().endsWith(“软件测试”); - } - }); - System.out.println("Result Page title: " + driver.getTitle()); - driver.quit(); - } \ No newline at end of file diff --git "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_2.java" "b/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_2.java" deleted file mode 100644 index d330753..0000000 --- "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_2.java" +++ /dev/null @@ -1,18 +0,0 @@ - -4.0.0     - MySel20Proj      - MySel20Proj -1.0 - - -org.seleniumhq.selenium         - selenium-java         - 2.53.0 - -         - org.seleniumhq.selenium         - htmlunit-driver         - 2.20 - - - diff --git "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_3.java" "b/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_3.java" deleted file mode 100644 index feffc79..0000000 --- "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_3.java" +++ /dev/null @@ -1,4 +0,0 @@ -java -jar selenium-server-standalone-x.xx.x.jar -role hub  - java -jar selenium-server-standalone-x.xx.x.jar -role node -port 5551  -java -jar selenium-server-standalone-x.xx.x.jar -role node -port 5552  -…… \ No newline at end of file diff --git "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_4.java" "b/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_4.java" deleted file mode 100644 index 02bd490..0000000 --- "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_4.java" +++ /dev/null @@ -1,27 +0,0 @@ -public class EditorTest extends - ActivityInstrumentationTestCase2 { - private Solo solo; - public EditorTest(){ - super(EditorActivity.class); -} -public void setUp() throws Exception { - solo = new Solo(getInstrumentation(),getActivity()); -} -public void testPreferenceIsSaved() throws Exception { - solo.sendKey(Solo.MENU); - solo.clickOnText("More"); - solo.clickOnText("Preferences"); - solo.clickOnText("Edit File Extensions") - solo.clickOnText(solo.searchText("rtf")); - solo.clickOnText("txt"); - solo.clearEditText(2); - solo.enterText(2,"robotium"); - solo.clickOnButton("Save"); - solo.goBack(); - solo.clickOnText("Edit File Extensions"); - Assert.assertTrue(solo.searchText("application/robotium")); - } - @Override - public void tearDown() throws Exception { - solo.finishOpenedActivities(); - } \ No newline at end of file diff --git "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_5.java" "b/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_5.java" deleted file mode 100644 index bfd4da8..0000000 --- "a/data/books/2.\345\205\250\347\250\213\350\275\257\344\273\266\346\265\213\350\257\225\357\274\210\347\254\2543\347\211\210\357\274\211/\347\254\25403\347\253\240 \345\207\206\345\244\207\357\274\232\345\237\272\347\241\200\350\256\276\346\226\275\344\270\216TA\346\241\206\346\236\266/3.4 \350\207\252\345\212\250\345\214\226\346\265\213\350\257\225\346\241\206\346\236\266/code_5.java" +++ /dev/null @@ -1,7 +0,0 @@ -Feature: Refund item - - Scenario: Jeff returns a faulty microwave - Given Jeff has bought a microwave for $100 - And he has a receipt - When he returns the microwave - Then Jeff should be refunded $100 \ No newline at end of file diff --git "a/data/topic_mapping/1.Python\347\274\226\347\250\213\346\227\240\345\270\210\350\207\252\351\200\232.json" "b/data/topic_mapping/1.Python\347\274\226\347\250\213\346\227\240\345\270\210\350\207\252\351\200\232.json" deleted file mode 100644 index 5e97fa3..0000000 --- "a/data/topic_mapping/1.Python\347\274\226\347\250\213\346\227\240\345\270\210\350\207\252\351\200\232.json" +++ /dev/null @@ -1,349 +0,0 @@ -{ - "data/books/1.Python编程无师自通/第22章 算法/22.2 顺序搜索/code_1.py": "https://bbs.csdn.net/topics/603857479", - "data/books/1.Python编程无师自通/第22章 算法/22.1 FizzBuzz/code_1.py": "https://bbs.csdn.net/topics/603857480", - "data/books/1.Python编程无师自通/第22章 算法/22.6 递归/code_1.py": "https://bbs.csdn.net/topics/603857653", - "data/books/1.Python编程无师自通/第22章 算法/22.6 递归/code_2.py": "https://bbs.csdn.net/topics/603857740", - "data/books/1.Python编程无师自通/第22章 算法/22.6 递归/code_3.py": "https://bbs.csdn.net/topics/603857654", - "data/books/1.Python编程无师自通/第22章 算法/22.3 回文词/code_1.py": "https://bbs.csdn.net/topics/603857590", - "data/books/1.Python编程无师自通/第22章 算法/22.4 变位词/code_1.py": "https://bbs.csdn.net/topics/603857741", - "data/books/1.Python编程无师自通/第22章 算法/22.5 计算字母频数/code_1.py": "https://bbs.csdn.net/topics/603857591", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_4.py": "https://bbs.csdn.net/topics/603857481", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_1.py": "https://bbs.csdn.net/topics/603857592", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_5.py": "https://bbs.csdn.net/topics/603857482", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_2.py": "https://bbs.csdn.net/topics/603857655", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_6.py": "https://bbs.csdn.net/topics/603857593", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_7.py": "https://bbs.csdn.net/topics/603857742", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_3.py": "https://bbs.csdn.net/topics/603857743", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.2 爬取Google新闻/code_8.py": "https://bbs.csdn.net/topics/603857483", - "data/books/1.Python编程无师自通/第20章 融会贯通/20.1 HTML/code_1.py": "https://bbs.csdn.net/topics/603857656", - "data/books/1.Python编程无师自通/第10章 综合练习/10.1 Hangman/code_4.py": "https://bbs.csdn.net/topics/603857657", - "data/books/1.Python编程无师自通/第10章 综合练习/10.1 Hangman/code_1.py": "https://bbs.csdn.net/topics/603857658", - "data/books/1.Python编程无师自通/第10章 综合练习/10.1 Hangman/code_2.py": "https://bbs.csdn.net/topics/603857744", - "data/books/1.Python编程无师自通/第10章 综合练习/10.1 Hangman/code_3.py": "https://bbs.csdn.net/topics/603857659", - "data/books/1.Python编程无师自通/第18章 包管理器/18.2 pip/code_4.py": "https://bbs.csdn.net/topics/603857484", - "data/books/1.Python编程无师自通/第18章 包管理器/18.2 pip/code_1.py": "https://bbs.csdn.net/topics/603857594", - "data/books/1.Python编程无师自通/第18章 包管理器/18.2 pip/code_5.py": "https://bbs.csdn.net/topics/603857660", - "data/books/1.Python编程无师自通/第18章 包管理器/18.2 pip/code_2.py": "https://bbs.csdn.net/topics/603857595", - "data/books/1.Python编程无师自通/第18章 包管理器/18.2 pip/code_6.py": "https://bbs.csdn.net/topics/603857661", - "data/books/1.Python编程无师自通/第18章 包管理器/18.2 pip/code_3.py": "https://bbs.csdn.net/topics/603857745", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.13 in关键字/code_1.py": "https://bbs.csdn.net/topics/603857596", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.13 in关键字/code_2.py": "https://bbs.csdn.net/topics/603857485", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.4 字符串拼接/code_1.py": "https://bbs.csdn.net/topics/603857746", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.3 字符串是不可变的/code_1.py": "https://bbs.csdn.net/topics/603857662", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.5 字符串乘法/code_1.py": "https://bbs.csdn.net/topics/603857486", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.12 查找索引/code_1.py": "https://bbs.csdn.net/topics/603857487", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.12 查找索引/code_2.py": "https://bbs.csdn.net/topics/603857597", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.12 查找索引/code_3.py": "https://bbs.csdn.net/topics/603857598", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.15 换行符/code_1.py": "https://bbs.csdn.net/topics/603857663", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.16 切片/code_4.py": "https://bbs.csdn.net/topics/603857664", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.16 切片/code_1.py": "https://bbs.csdn.net/topics/603857747", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.16 切片/code_5.py": "https://bbs.csdn.net/topics/603857488", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.16 切片/code_2.py": "https://bbs.csdn.net/topics/603857748", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.16 切片/code_3.py": "https://bbs.csdn.net/topics/603857489", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.1 三引号字符串/code_1.py": "https://bbs.csdn.net/topics/603857599", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.6 改变大小写/code_1.py": "https://bbs.csdn.net/topics/603857665", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.6 改变大小写/code_2.py": "https://bbs.csdn.net/topics/603857490", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.6 改变大小写/code_3.py": "https://bbs.csdn.net/topics/603857491", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.2 索引/code_4.py": "https://bbs.csdn.net/topics/603857666", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.2 索引/code_1.py": "https://bbs.csdn.net/topics/603857749", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.2 索引/code_2.py": "https://bbs.csdn.net/topics/603857492", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.2 索引/code_3.py": "https://bbs.csdn.net/topics/603857667", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.7 格式化/code_4.py": "https://bbs.csdn.net/topics/603857750", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.7 格式化/code_1.py": "https://bbs.csdn.net/topics/603857800", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.7 格式化/code_2.py": "https://bbs.csdn.net/topics/603857751", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.7 格式化/code_3.py": "https://bbs.csdn.net/topics/603857752", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.11 替换/code_1.py": "https://bbs.csdn.net/topics/603857753", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.8 分割/code_1.py": "https://bbs.csdn.net/topics/603857668", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.14 字符串转义/code_4.py": "https://bbs.csdn.net/topics/603857801", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.14 字符串转义/code_1.py": "https://bbs.csdn.net/topics/603857802", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.14 字符串转义/code_2.py": "https://bbs.csdn.net/topics/603857493", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.14 字符串转义/code_3.py": "https://bbs.csdn.net/topics/603857754", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.10 去除空格/code_1.py": "https://bbs.csdn.net/topics/603857669", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.9 连接/code_1.py": "https://bbs.csdn.net/topics/603857670", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.9 连接/code_2.py": "https://bbs.csdn.net/topics/603857755", - "data/books/1.Python编程无师自通/第06章 字符串操作/6.9 连接/code_3.py": "https://bbs.csdn.net/topics/603857494", - "data/books/1.Python编程无师自通/第03章 编程概论/code_0.py": "https://bbs.csdn.net/topics/603857671", - "data/books/1.Python编程无师自通/第03章 编程概论/3.9 语法/code_1.py": "https://bbs.csdn.net/topics/603857803", - "data/books/1.Python编程无师自通/第03章 编程概论/3.11 算术操作符/code_4.py": "https://bbs.csdn.net/topics/603857756", - "data/books/1.Python编程无师自通/第03章 编程概论/3.11 算术操作符/code_1.py": "https://bbs.csdn.net/topics/603857672", - "data/books/1.Python编程无师自通/第03章 编程概论/3.11 算术操作符/code_5.py": "https://bbs.csdn.net/topics/603857673", - "data/books/1.Python编程无师自通/第03章 编程概论/3.11 算术操作符/code_2.py": "https://bbs.csdn.net/topics/603857674", - "data/books/1.Python编程无师自通/第03章 编程概论/3.11 算术操作符/code_6.py": "https://bbs.csdn.net/topics/603857757", - "data/books/1.Python编程无师自通/第03章 编程概论/3.11 算术操作符/code_3.py": "https://bbs.csdn.net/topics/603857495", - "data/books/1.Python编程无师自通/第03章 编程概论/3.2 注释/code_1.py": "https://bbs.csdn.net/topics/603857804", - "data/books/1.Python编程无师自通/第03章 编程概论/3.2 注释/code_2.py": "https://bbs.csdn.net/topics/603857758", - "data/books/1.Python编程无师自通/第03章 编程概论/3.2 注释/code_3.py": "https://bbs.csdn.net/topics/603857675", - "data/books/1.Python编程无师自通/第03章 编程概论/3.12 比较操作符/code_4.py": "https://bbs.csdn.net/topics/603857759", - "data/books/1.Python编程无师自通/第03章 编程概论/3.12 比较操作符/code_1.py": "https://bbs.csdn.net/topics/603857496", - "data/books/1.Python编程无师自通/第03章 编程概论/3.12 比较操作符/code_5.py": "https://bbs.csdn.net/topics/603857805", - "data/books/1.Python编程无师自通/第03章 编程概论/3.12 比较操作符/code_2.py": "https://bbs.csdn.net/topics/603857676", - "data/books/1.Python编程无师自通/第03章 编程概论/3.12 比较操作符/code_6.py": "https://bbs.csdn.net/topics/603857806", - "data/books/1.Python编程无师自通/第03章 编程概论/3.12 比较操作符/code_3.py": "https://bbs.csdn.net/topics/603857760", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_4.py": "https://bbs.csdn.net/topics/603857497", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_1.py": "https://bbs.csdn.net/topics/603857677", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_5.py": "https://bbs.csdn.net/topics/603857498", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_2.py": "https://bbs.csdn.net/topics/603857678", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_6.py": "https://bbs.csdn.net/topics/603857761", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_7.py": "https://bbs.csdn.net/topics/603857807", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_3.py": "https://bbs.csdn.net/topics/603857679", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_8.py": "https://bbs.csdn.net/topics/603857762", - "data/books/1.Python编程无师自通/第03章 编程概论/3.8 常量和变量/code_9.py": "https://bbs.csdn.net/topics/603857808", - "data/books/1.Python编程无师自通/第03章 编程概论/3.4 代码行/code_1.py": "https://bbs.csdn.net/topics/603857809", - "data/books/1.Python编程无师自通/第03章 编程概论/3.4 代码行/code_2.py": "https://bbs.csdn.net/topics/603857763", - "data/books/1.Python编程无师自通/第03章 编程概论/3.4 代码行/code_3.py": "https://bbs.csdn.net/topics/603857680", - "data/books/1.Python编程无师自通/第03章 编程概论/3.7 数据类型/code_4.py": "https://bbs.csdn.net/topics/603857810", - "data/books/1.Python编程无师自通/第03章 编程概论/3.7 数据类型/code_1.py": "https://bbs.csdn.net/topics/603857811", - "data/books/1.Python编程无师自通/第03章 编程概论/3.7 数据类型/code_2.py": "https://bbs.csdn.net/topics/603857764", - "data/books/1.Python编程无师自通/第03章 编程概论/3.7 数据类型/code_3.py": "https://bbs.csdn.net/topics/603857681", - "data/books/1.Python编程无师自通/第03章 编程概论/3.13 逻辑操作符/code_4.py": "https://bbs.csdn.net/topics/603857812", - "data/books/1.Python编程无师自通/第03章 编程概论/3.13 逻辑操作符/code_1.py": "https://bbs.csdn.net/topics/603857499", - "data/books/1.Python编程无师自通/第03章 编程概论/3.13 逻辑操作符/code_5.py": "https://bbs.csdn.net/topics/603857765", - "data/books/1.Python编程无师自通/第03章 编程概论/3.13 逻辑操作符/code_2.py": "https://bbs.csdn.net/topics/603857900", - "data/books/1.Python编程无师自通/第03章 编程概论/3.13 逻辑操作符/code_3.py": "https://bbs.csdn.net/topics/603857682", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_4.py": "https://bbs.csdn.net/topics/603857901", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_1.py": "https://bbs.csdn.net/topics/603857813", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_5.py": "https://bbs.csdn.net/topics/603857766", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_2.py": "https://bbs.csdn.net/topics/603857902", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_6.py": "https://bbs.csdn.net/topics/603857903", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_7.py": "https://bbs.csdn.net/topics/603857814", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_3.py": "https://bbs.csdn.net/topics/603857683", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_8.py": "https://bbs.csdn.net/topics/603857815", - "data/books/1.Python编程无师自通/第03章 编程概论/3.14 条件语句/code_9.py": "https://bbs.csdn.net/topics/603857684", - "data/books/1.Python编程无师自通/第03章 编程概论/3.3 打印/code_1.py": "https://bbs.csdn.net/topics/603857685", - "data/books/1.Python编程无师自通/第03章 编程概论/3.15 语句/code_4.py": "https://bbs.csdn.net/topics/603857767", - "data/books/1.Python编程无师自通/第03章 编程概论/3.15 语句/code_1.py": "https://bbs.csdn.net/topics/603857904", - "data/books/1.Python编程无师自通/第03章 编程概论/3.15 语句/code_2.py": "https://bbs.csdn.net/topics/603857905", - "data/books/1.Python编程无师自通/第03章 编程概论/3.15 语句/code_3.py": "https://bbs.csdn.net/topics/603857906", - "data/books/1.Python编程无师自通/第03章 编程概论/3.10 错误与异常/code_1.py": "https://bbs.csdn.net/topics/603857907", - "data/books/1.Python编程无师自通/第03章 编程概论/3.10 错误与异常/code_2.py": "https://bbs.csdn.net/topics/603857686", - "data/books/1.Python编程无师自通/第03章 编程概论/3.10 错误与异常/code_3.py": "https://bbs.csdn.net/topics/603857687", - "data/books/1.Python编程无师自通/第03章 编程概论/3.6 间距/code_1.py": "https://bbs.csdn.net/topics/603857768", - "data/books/1.Python编程无师自通/第03章 编程概论/3.6 间距/code_2.py": "https://bbs.csdn.net/topics/603857769", - "data/books/1.Python编程无师自通/第03章 编程概论/3.1 示例/code_1.py": "https://bbs.csdn.net/topics/603857908", - "data/books/1.Python编程无师自通/第09章 文件/9.1 写文件操作/code_1.py": "https://bbs.csdn.net/topics/603857909", - "data/books/1.Python编程无师自通/第09章 文件/9.1 写文件操作/code_2.py": "https://bbs.csdn.net/topics/603857770", - "data/books/1.Python编程无师自通/第09章 文件/9.4 CSV文件/code_1.py": "https://bbs.csdn.net/topics/603857816", - "data/books/1.Python编程无师自通/第09章 文件/9.4 CSV文件/code_2.py": "https://bbs.csdn.net/topics/603857817", - "data/books/1.Python编程无师自通/第09章 文件/9.2 自动关闭文件/code_1.py": "https://bbs.csdn.net/topics/603857818", - "data/books/1.Python编程无师自通/第09章 文件/9.3 读取文件/code_1.py": "https://bbs.csdn.net/topics/603857688", - "data/books/1.Python编程无师自通/第09章 文件/9.3 读取文件/code_2.py": "https://bbs.csdn.net/topics/603857689", - "data/books/1.Python编程无师自通/第12章 编程范式/12.2 过程式编程/code_1.py": "https://bbs.csdn.net/topics/603857910", - "data/books/1.Python编程无师自通/第12章 编程范式/12.2 过程式编程/code_2.py": "https://bbs.csdn.net/topics/603857819", - "data/books/1.Python编程无师自通/第12章 编程范式/12.3 函数式编程/code_1.py": "https://bbs.csdn.net/topics/603857690", - "data/books/1.Python编程无师自通/第12章 编程范式/12.3 函数式编程/code_2.py": "https://bbs.csdn.net/topics/603857771", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_4.py": "https://bbs.csdn.net/topics/603857691", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_1.py": "https://bbs.csdn.net/topics/603857692", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_5.py": "https://bbs.csdn.net/topics/603857911", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_2.py": "https://bbs.csdn.net/topics/603857772", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_6.py": "https://bbs.csdn.net/topics/603857912", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_7.py": "https://bbs.csdn.net/topics/603857820", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_3.py": "https://bbs.csdn.net/topics/603857773", - "data/books/1.Python编程无师自通/第12章 编程范式/12.4 面向对象编程/code_8.py": "https://bbs.csdn.net/topics/603857774", - "data/books/1.Python编程无师自通/第08章 模块/8.2 导入其他模块/code_4.py": "https://bbs.csdn.net/topics/603857693", - "data/books/1.Python编程无师自通/第08章 模块/8.2 导入其他模块/code_1.py": "https://bbs.csdn.net/topics/603857913", - "data/books/1.Python编程无师自通/第08章 模块/8.2 导入其他模块/code_5.py": "https://bbs.csdn.net/topics/603857694", - "data/books/1.Python编程无师自通/第08章 模块/8.2 导入其他模块/code_2.py": "https://bbs.csdn.net/topics/603857914", - "data/books/1.Python编程无师自通/第08章 模块/8.2 导入其他模块/code_6.py": "https://bbs.csdn.net/topics/603857775", - "data/books/1.Python编程无师自通/第08章 模块/8.2 导入其他模块/code_3.py": "https://bbs.csdn.net/topics/603857776", - "data/books/1.Python编程无师自通/第08章 模块/8.1 导入内置模块/code_4.py": "https://bbs.csdn.net/topics/603857821", - "data/books/1.Python编程无师自通/第08章 模块/8.1 导入内置模块/code_1.py": "https://bbs.csdn.net/topics/603857695", - "data/books/1.Python编程无师自通/第08章 模块/8.1 导入内置模块/code_5.py": "https://bbs.csdn.net/topics/603857822", - "data/books/1.Python编程无师自通/第08章 模块/8.1 导入内置模块/code_2.py": "https://bbs.csdn.net/topics/603857823", - "data/books/1.Python编程无师自通/第08章 模块/8.1 导入内置模块/code_3.py": "https://bbs.csdn.net/topics/603857824", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.1 类变量与实例变量/code_1.py": "https://bbs.csdn.net/topics/603857825", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.1 类变量与实例变量/code_2.py": "https://bbs.csdn.net/topics/603857696", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.1 类变量与实例变量/code_3.py": "https://bbs.csdn.net/topics/603857777", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.3 is/code_1.py": "https://bbs.csdn.net/topics/603857915", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.3 is/code_2.py": "https://bbs.csdn.net/topics/603857697", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.2 魔法方法/code_1.py": "https://bbs.csdn.net/topics/603857826", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.2 魔法方法/code_2.py": "https://bbs.csdn.net/topics/603857698", - "data/books/1.Python编程无师自通/第14章 深入面向对象编程/14.2 魔法方法/code_3.py": "https://bbs.csdn.net/topics/603857916", - "data/books/1.Python编程无师自通/第19章 版本控制/19.7 diff/code_4.py": "https://bbs.csdn.net/topics/603858002", - "data/books/1.Python编程无师自通/第19章 版本控制/19.7 diff/code_1.py": "https://bbs.csdn.net/topics/603857781", - "data/books/1.Python编程无师自通/第19章 版本控制/19.7 diff/code_5.py": "https://bbs.csdn.net/topics/603857784", - "data/books/1.Python编程无师自通/第19章 版本控制/19.7 diff/code_2.py": "https://bbs.csdn.net/topics/603857830", - "data/books/1.Python编程无师自通/第19章 版本控制/19.7 diff/code_3.py": "https://bbs.csdn.net/topics/603857919", - "data/books/1.Python编程无师自通/第19章 版本控制/19.2 入门/code_1.py": "https://bbs.csdn.net/topics/603857835", - "data/books/1.Python编程无师自通/第19章 版本控制/19.2 入门/code_2.py": "https://bbs.csdn.net/topics/603858012", - "data/books/1.Python编程无师自通/第19章 版本控制/19.2 入门/code_3.py": "https://bbs.csdn.net/topics/603857792", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_4.py": "https://bbs.csdn.net/topics/603857793", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_1.py": "https://bbs.csdn.net/topics/603857926", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_5.py": "https://bbs.csdn.net/topics/603858013", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_2.py": "https://bbs.csdn.net/topics/603858014", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_6.py": "https://bbs.csdn.net/topics/603857836", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_7.py": "https://bbs.csdn.net/topics/603857927", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_3.py": "https://bbs.csdn.net/topics/603857794", - "data/books/1.Python编程无师自通/第19章 版本控制/19.4 推送示例/code_8.py": "https://bbs.csdn.net/topics/603857795", - "data/books/1.Python编程无师自通/第19章 版本控制/19.5 拉取示例/code_1.py": "https://bbs.csdn.net/topics/603857796", - "data/books/1.Python编程无师自通/第19章 版本控制/19.5 拉取示例/code_2.py": "https://bbs.csdn.net/topics/603857797", - "data/books/1.Python编程无师自通/第19章 版本控制/19.3 推送和拉取/code_1.py": "https://bbs.csdn.net/topics/603857928", - "data/books/1.Python编程无师自通/第19章 版本控制/19.6 回退版本/code_1.py": "https://bbs.csdn.net/topics/603857837", - "data/books/1.Python编程无师自通/第15章 综合练习/15.5 战争/code_1.py": "https://bbs.csdn.net/topics/603857929", - "data/books/1.Python编程无师自通/第15章 综合练习/15.3 玩家/code_1.py": "https://bbs.csdn.net/topics/603857838", - "data/books/1.Python编程无师自通/第15章 综合练习/15.4 游戏/code_1.py": "https://bbs.csdn.net/topics/603858015", - "data/books/1.Python编程无师自通/第15章 综合练习/15.2 牌堆/code_1.py": "https://bbs.csdn.net/topics/603857839", - "data/books/1.Python编程无师自通/第15章 综合练习/15.2 牌堆/code_2.py": "https://bbs.csdn.net/topics/603857840", - "data/books/1.Python编程无师自通/第15章 综合练习/15.1 卡牌/code_1.py": "https://bbs.csdn.net/topics/603857930", - "data/books/1.Python编程无师自通/第15章 综合练习/15.1 卡牌/code_2.py": "https://bbs.csdn.net/topics/603858016", - "data/books/1.Python编程无师自通/第15章 综合练习/15.1 卡牌/code_3.py": "https://bbs.csdn.net/topics/603858017", - "data/books/1.Python编程无师自通/第21章 数据结构/21.2 栈/code_4.py": "https://bbs.csdn.net/topics/603857931", - "data/books/1.Python编程无师自通/第21章 数据结构/21.2 栈/code_1.py": "https://bbs.csdn.net/topics/603857798", - "data/books/1.Python编程无师自通/第21章 数据结构/21.2 栈/code_5.py": "https://bbs.csdn.net/topics/603857932", - "data/books/1.Python编程无师自通/第21章 数据结构/21.2 栈/code_2.py": "https://bbs.csdn.net/topics/603857933", - "data/books/1.Python编程无师自通/第21章 数据结构/21.2 栈/code_3.py": "https://bbs.csdn.net/topics/603857934", - "data/books/1.Python编程无师自通/第21章 数据结构/21.5 购票队列/code_1.py": "https://bbs.csdn.net/topics/603857841", - "data/books/1.Python编程无师自通/第21章 数据结构/21.3 使用栈逆转字符串/code_1.py": "https://bbs.csdn.net/topics/603857842", - "data/books/1.Python编程无师自通/第21章 数据结构/21.4 队列/code_4.py": "https://bbs.csdn.net/topics/603858018", - "data/books/1.Python编程无师自通/第21章 数据结构/21.4 队列/code_1.py": "https://bbs.csdn.net/topics/603857935", - "data/books/1.Python编程无师自通/第21章 数据结构/21.4 队列/code_2.py": "https://bbs.csdn.net/topics/603858019", - "data/books/1.Python编程无师自通/第21章 数据结构/21.4 队列/code_3.py": "https://bbs.csdn.net/topics/603857799", - "data/books/1.Python编程无师自通/第02章 起步/2.1 什么是编程/code_1.py": "https://bbs.csdn.net/topics/603858100", - "data/books/1.Python编程无师自通/第02章 起步/2.1 什么是编程/code_2.py": "https://bbs.csdn.net/topics/603857843", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_4.py": "https://bbs.csdn.net/topics/603857844", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_1.py": "https://bbs.csdn.net/topics/603858101", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_5.py": "https://bbs.csdn.net/topics/603857936", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_2.py": "https://bbs.csdn.net/topics/603858020", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_6.py": "https://bbs.csdn.net/topics/603858103", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_7.py": "https://bbs.csdn.net/topics/603857937", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_3.py": "https://bbs.csdn.net/topics/603857846", - "data/books/1.Python编程无师自通/第05章 容器/5.4 字典/code_8.py": "https://bbs.csdn.net/topics/603858021", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_13.py": "https://bbs.csdn.net/topics/603857938", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_4.py": "https://bbs.csdn.net/topics/603857848", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_1.py": "https://bbs.csdn.net/topics/603857943", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_12.py": "https://bbs.csdn.net/topics/603858027", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_5.py": "https://bbs.csdn.net/topics/603857857", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_15.py": "https://bbs.csdn.net/topics/603857951", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_2.py": "https://bbs.csdn.net/topics/603858031", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_11.py": "https://bbs.csdn.net/topics/603857858", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_6.py": "https://bbs.csdn.net/topics/603857952", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_10.py": "https://bbs.csdn.net/topics/603858112", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_7.py": "https://bbs.csdn.net/topics/603857859", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_14.py": "https://bbs.csdn.net/topics/603858113", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_3.py": "https://bbs.csdn.net/topics/603857953", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_8.py": "https://bbs.csdn.net/topics/603857860", - "data/books/1.Python编程无师自通/第05章 容器/5.2 列表/code_9.py": "https://bbs.csdn.net/topics/603857954", - "data/books/1.Python编程无师自通/第05章 容器/5.1 方法/code_1.py": "https://bbs.csdn.net/topics/603857955", - "data/books/1.Python编程无师自通/第05章 容器/5.5 容器嵌套容器/code_4.py": "https://bbs.csdn.net/topics/603858032", - "data/books/1.Python编程无师自通/第05章 容器/5.5 容器嵌套容器/code_1.py": "https://bbs.csdn.net/topics/603858033", - "data/books/1.Python编程无师自通/第05章 容器/5.5 容器嵌套容器/code_5.py": "https://bbs.csdn.net/topics/603857956", - "data/books/1.Python编程无师自通/第05章 容器/5.5 容器嵌套容器/code_2.py": "https://bbs.csdn.net/topics/603858034", - "data/books/1.Python编程无师自通/第05章 容器/5.5 容器嵌套容器/code_3.py": "https://bbs.csdn.net/topics/603857861", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_4.py": "https://bbs.csdn.net/topics/603858035", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_1.py": "https://bbs.csdn.net/topics/603858114", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_5.py": "https://bbs.csdn.net/topics/603858036", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_2.py": "https://bbs.csdn.net/topics/603858037", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_6.py": "https://bbs.csdn.net/topics/603857862", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_7.py": "https://bbs.csdn.net/topics/603857957", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_3.py": "https://bbs.csdn.net/topics/603858115", - "data/books/1.Python编程无师自通/第05章 容器/5.3 元组/code_8.py": "https://bbs.csdn.net/topics/603857958", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.4 继承/code_4.py": "https://bbs.csdn.net/topics/603857863", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.4 继承/code_1.py": "https://bbs.csdn.net/topics/603857959", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.4 继承/code_2.py": "https://bbs.csdn.net/topics/603858038", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.4 继承/code_3.py": "https://bbs.csdn.net/topics/603858116", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.1 封装/code_4.py": "https://bbs.csdn.net/topics/603858039", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.1 封装/code_1.py": "https://bbs.csdn.net/topics/603858040", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.1 封装/code_2.py": "https://bbs.csdn.net/topics/603858117", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.1 封装/code_3.py": "https://bbs.csdn.net/topics/603857960", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.5 组合/code_1.py": "https://bbs.csdn.net/topics/603858041", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.5 组合/code_2.py": "https://bbs.csdn.net/topics/603858118", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.3 多态/code_1.py": "https://bbs.csdn.net/topics/603857864", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.3 多态/code_2.py": "https://bbs.csdn.net/topics/603857865", - "data/books/1.Python编程无师自通/第13章 面向对象编程的四大支柱/13.3 多态/code_3.py": "https://bbs.csdn.net/topics/603857961", - "data/books/1.Python编程无师自通/第07章 循环/7.4 break语句/code_1.py": "https://bbs.csdn.net/topics/603858042", - "data/books/1.Python编程无师自通/第07章 循环/7.4 break语句/code_2.py": "https://bbs.csdn.net/topics/603857866", - "data/books/1.Python编程无师自通/第07章 循环/7.4 break语句/code_3.py": "https://bbs.csdn.net/topics/603857962", - "data/books/1.Python编程无师自通/第07章 循环/7.3 while循环/code_1.py": "https://bbs.csdn.net/topics/603857867", - "data/books/1.Python编程无师自通/第07章 循环/7.3 while循环/code_2.py": "https://bbs.csdn.net/topics/603857868", - "data/books/1.Python编程无师自通/第07章 循环/7.6 嵌套循环/code_1.py": "https://bbs.csdn.net/topics/603858119", - "data/books/1.Python编程无师自通/第07章 循环/7.6 嵌套循环/code_2.py": "https://bbs.csdn.net/topics/603858043", - "data/books/1.Python编程无师自通/第07章 循环/7.6 嵌套循环/code_3.py": "https://bbs.csdn.net/topics/603857869", - "data/books/1.Python编程无师自通/第07章 循环/7.2 range函数/code_1.py": "https://bbs.csdn.net/topics/603858044", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_4.py": "https://bbs.csdn.net/topics/603858120", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_1.py": "https://bbs.csdn.net/topics/603858121", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_5.py": "https://bbs.csdn.net/topics/603857963", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_2.py": "https://bbs.csdn.net/topics/603857870", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_6.py": "https://bbs.csdn.net/topics/603858045", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_7.py": "https://bbs.csdn.net/topics/603858122", - "data/books/1.Python编程无师自通/第07章 循环/7.1 for循环/code_3.py": "https://bbs.csdn.net/topics/603858123", - "data/books/1.Python编程无师自通/第07章 循环/7.5 continue语句/code_1.py": "https://bbs.csdn.net/topics/603857871", - "data/books/1.Python编程无师自通/第07章 循环/7.5 continue语句/code_2.py": "https://bbs.csdn.net/topics/603857872", - "data/books/1.Python编程无师自通/第16章 Bash/16.11 用户/code_1.py": "https://bbs.csdn.net/topics/603858124", - "data/books/1.Python编程无师自通/第16章 Bash/16.11 用户/code_2.py": "https://bbs.csdn.net/topics/603857873", - "data/books/1.Python编程无师自通/第16章 Bash/16.7 旗标/code_1.py": "https://bbs.csdn.net/topics/603857874", - "data/books/1.Python编程无师自通/第16章 Bash/16.7 旗标/code_2.py": "https://bbs.csdn.net/topics/603858125", - "data/books/1.Python编程无师自通/第16章 Bash/16.9 管道/code_1.py": "https://bbs.csdn.net/topics/603857964", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_4.py": "https://bbs.csdn.net/topics/603858126", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_1.py": "https://bbs.csdn.net/topics/603857965", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_5.py": "https://bbs.csdn.net/topics/603858046", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_2.py": "https://bbs.csdn.net/topics/603857875", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_6.py": "https://bbs.csdn.net/topics/603857876", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_7.py": "https://bbs.csdn.net/topics/603858127", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_3.py": "https://bbs.csdn.net/topics/603857877", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_8.py": "https://bbs.csdn.net/topics/603857966", - "data/books/1.Python编程无师自通/第16章 Bash/16.6 导航/code_9.py": "https://bbs.csdn.net/topics/603858047", - "data/books/1.Python编程无师自通/第16章 Bash/16.8 隐藏文件/code_1.py": "https://bbs.csdn.net/topics/603857967", - "data/books/1.Python编程无师自通/第16章 Bash/16.10 环境变量/code_1.py": "https://bbs.csdn.net/topics/603858048", - "data/books/1.Python编程无师自通/第16章 Bash/16.10 环境变量/code_2.py": "https://bbs.csdn.net/topics/603858128", - "data/books/1.Python编程无师自通/第16章 Bash/16.3 命令/code_1.py": "https://bbs.csdn.net/topics/603858129", - "data/books/1.Python编程无师自通/第16章 Bash/16.3 命令/code_2.py": "https://bbs.csdn.net/topics/603857968", - "data/books/1.Python编程无师自通/第16章 Bash/16.3 命令/code_3.py": "https://bbs.csdn.net/topics/603857878", - "data/books/1.Python编程无师自通/第16章 Bash/16.4 最近命令/code_1.py": "https://bbs.csdn.net/topics/603857969", - "data/books/1.Python编程无师自通/第16章 Bash/16.5 相对路径与绝对路径/code_1.py": "https://bbs.csdn.net/topics/603858049", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.5 匹配数字/code_1.py": "https://bbs.csdn.net/topics/603857970", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.5 匹配数字/code_2.py": "https://bbs.csdn.net/topics/603857971", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.1 初始配置/code_1.py": "https://bbs.csdn.net/topics/603857879", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.2 简单匹配/code_4.py": "https://bbs.csdn.net/topics/603857972", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.2 简单匹配/code_1.py": "https://bbs.csdn.net/topics/603857880", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.2 简单匹配/code_5.py": "https://bbs.csdn.net/topics/603858050", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.2 简单匹配/code_2.py": "https://bbs.csdn.net/topics/603858130", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.2 简单匹配/code_6.py": "https://bbs.csdn.net/topics/603858051", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.2 简单匹配/code_3.py": "https://bbs.csdn.net/topics/603858052", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.6 重复/code_4.py": "https://bbs.csdn.net/topics/603858131", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.6 重复/code_1.py": "https://bbs.csdn.net/topics/603857881", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.6 重复/code_5.py": "https://bbs.csdn.net/topics/603858053", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.6 重复/code_2.py": "https://bbs.csdn.net/topics/603857882", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.6 重复/code_3.py": "https://bbs.csdn.net/topics/603857973", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.3 匹配起始位置/code_1.py": "https://bbs.csdn.net/topics/603858132", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.3 匹配起始位置/code_2.py": "https://bbs.csdn.net/topics/603858133", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.3 匹配起始位置/code_3.py": "https://bbs.csdn.net/topics/603857883", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.7 转义/code_1.py": "https://bbs.csdn.net/topics/603857884", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.7 转义/code_2.py": "https://bbs.csdn.net/topics/603857885", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.4 匹配多个字符/code_1.py": "https://bbs.csdn.net/topics/603857886", - "data/books/1.Python编程无师自通/第17章 正则表达式/17.4 匹配多个字符/code_2.py": "https://bbs.csdn.net/topics/603857974", - "data/books/1.Python编程无师自通/第04章 函数/4.10 有需要才使用变量/code_1.py": "https://bbs.csdn.net/topics/603857975", - "data/books/1.Python编程无师自通/第04章 函数/4.10 有需要才使用变量/code_2.py": "https://bbs.csdn.net/topics/603857976", - "data/books/1.Python编程无师自通/第04章 函数/4.9 文档字符串/code_1.py": "https://bbs.csdn.net/topics/603858134", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_4.py": "https://bbs.csdn.net/topics/603857887", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_1.py": "https://bbs.csdn.net/topics/603857977", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_5.py": "https://bbs.csdn.net/topics/603858135", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_2.py": "https://bbs.csdn.net/topics/603858054", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_6.py": "https://bbs.csdn.net/topics/603858055", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_7.py": "https://bbs.csdn.net/topics/603858136", - "data/books/1.Python编程无师自通/第04章 函数/4.4 内置函数/code_3.py": "https://bbs.csdn.net/topics/603857978", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_4.py": "https://bbs.csdn.net/topics/603857888", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_1.py": "https://bbs.csdn.net/topics/603857889", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_5.py": "https://bbs.csdn.net/topics/603858056", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_2.py": "https://bbs.csdn.net/topics/603858137", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_6.py": "https://bbs.csdn.net/topics/603858057", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_7.py": "https://bbs.csdn.net/topics/603858138", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_3.py": "https://bbs.csdn.net/topics/603858139", - "data/books/1.Python编程无师自通/第04章 函数/4.3 定义函数/code_8.py": "https://bbs.csdn.net/topics/603857890", - "data/books/1.Python编程无师自通/第04章 函数/4.7 作用域/code_4.py": "https://bbs.csdn.net/topics/603858140", - "data/books/1.Python编程无师自通/第04章 函数/4.7 作用域/code_1.py": "https://bbs.csdn.net/topics/603857979", - "data/books/1.Python编程无师自通/第04章 函数/4.7 作用域/code_5.py": "https://bbs.csdn.net/topics/603857980", - "data/books/1.Python编程无师自通/第04章 函数/4.7 作用域/code_2.py": "https://bbs.csdn.net/topics/603857981", - "data/books/1.Python编程无师自通/第04章 函数/4.7 作用域/code_6.py": "https://bbs.csdn.net/topics/603857982", - "data/books/1.Python编程无师自通/第04章 函数/4.7 作用域/code_3.py": "https://bbs.csdn.net/topics/603857891", - "data/books/1.Python编程无师自通/第04章 函数/4.2 函数/code_1.py": "https://bbs.csdn.net/topics/603858141", - "data/books/1.Python编程无师自通/第04章 函数/4.5 复用函数/code_1.py": "https://bbs.csdn.net/topics/603858058", - "data/books/1.Python编程无师自通/第04章 函数/4.5 复用函数/code_2.py": "https://bbs.csdn.net/topics/603858059", - "data/books/1.Python编程无师自通/第04章 函数/4.5 复用函数/code_3.py": "https://bbs.csdn.net/topics/603858060", - "data/books/1.Python编程无师自通/第04章 函数/4.8 异常处理/code_4.py": "https://bbs.csdn.net/topics/603858142", - "data/books/1.Python编程无师自通/第04章 函数/4.8 异常处理/code_1.py": "https://bbs.csdn.net/topics/603857892", - "data/books/1.Python编程无师自通/第04章 函数/4.8 异常处理/code_5.py": "https://bbs.csdn.net/topics/603858143", - "data/books/1.Python编程无师自通/第04章 函数/4.8 异常处理/code_2.py": "https://bbs.csdn.net/topics/603857893", - "data/books/1.Python编程无师自通/第04章 函数/4.8 异常处理/code_6.py": "https://bbs.csdn.net/topics/603858061", - "data/books/1.Python编程无师自通/第04章 函数/4.8 异常处理/code_3.py": "https://bbs.csdn.net/topics/603858144", - "data/books/1.Python编程无师自通/第04章 函数/4.6 必选及可选参数/code_1.py": "https://bbs.csdn.net/topics/603858145", - "data/books/1.Python编程无师自通/第04章 函数/4.6 必选及可选参数/code_2.py": "https://bbs.csdn.net/topics/603857983" -} \ No newline at end of file diff --git a/helper.py b/helper.py deleted file mode 100644 index 3f104ed..0000000 --- a/helper.py +++ /dev/null @@ -1,147 +0,0 @@ -import os -import json -import html -import requests -import logging - -logger = logging.getLogger(__name__) - - -def modify_dir_name(): - data_dir = 'data' - dir_list_ = os.listdir(data_dir) - # print(dir_list_) - dir_list = [] - for i in dir_list_: - root_dir = os.path.join(data_dir, i) - if os.path.isdir(root_dir): - dir_list.append(root_dir) - - chapter_dir_list = [] - for root_dir in dir_list: - dir_list_ = os.listdir(root_dir) - for i in dir_list_: - root_dir_ = os.path.join(root_dir, i) - if os.path.isdir(root_dir_): - # print(root_dir_) - chapter_dir_list.append(root_dir_) - dst_dir_list = [] - for chapter_dir in chapter_dir_list: - exercises_dir = os.listdir(chapter_dir) - for tem_dir in exercises_dir: - exercise_path = os.path.join(chapter_dir, tem_dir) - if os.path.isdir(exercise_path): - # print(exercise_path) - dst_dir_list.append(exercise_path) - - for dst_dir in dst_dir_list: - try: - dir_name = dst_dir.split('/')[-1] - root_dir = '/'.join(dst_dir.split('/')[:-1]) - res_dir_name = dir_name.split(' ')[1] - number = dir_name.split(' ')[0].split('.')[1] + '.' - res_dir_name = number + res_dir_name - print(dst_dir) - final_name = os.path.join(root_dir, res_dir_name) - print(final_name) - os.rename(dst_dir, final_name) - except: - print(dst_dir) - - -def get_files_path(file_dir, filetype='.txt'): - """得到文件夹下的所有.txt文件的路径 - Args: - file_dir: 文件夹路径 - filetype: 文件后缀 - Returns: - 所有filetype类型文件的绝对路径 - """ - files_path = [] - for root, dirs, files in os.walk(file_dir): - for file in files: - if filetype is None or (os.path.splitext(file)[1] == filetype): - files_path.append(os.path.join(root, file)) - return files_path - - -def post(url, params, retry=3, headers=None): - if headers is None: - hdrs = {"Content-Type": "application/json"} - else: - hdrs = headers - fails = 0 - while fails < retry: - try: - if headers is None: - data = json.dumps(params) - else: - data = params - logger.debug(f"will post {data} to {url}") - resp = requests.post(url, data, headers=hdrs, timeout=10) - if resp: - logger.info(f"resp {resp.content}") - return resp.json() - else: - logger.error(f"resp: [{resp}]") - fails += 1 - except Exception as error: - logger.error(f"post {params} to {url} failed {error}") - fails += 1 - if fails > retry: - raise error - - -def send_topic(): - data_dir = 'data' - - web_url = "https://codechina.csdn.net/csdn/content/book_code_c798a5992a654857867ec15660e1c32a/-/blob/master/" - request_url = 'http://ccloud.internal.csdn.net/v1/internal/community/content/sendTopic' - - files = get_files_path('data/books/1.Python编程无师自通', '.py') - mapping_path = 'data/topic_mapping/1.Python编程无师自通.json' - - with open(mapping_path, 'r') as f: - chapter_code_mapping = json.load(f) - - for file in files: - topic_title = file.replace('data/books/Python编程无师自通/', '') - topic_title = topic_title.replace('/', '|') - topic_title = topic_title.replace(' ', '.') - # topic_title = html.escape(topic_title) - topic_content = web_url + file - topic_content = "代码:{}".format( - topic_content, topic_title) - - send_topic_request_param = { - "type": "long_text", - "cateId": 20890, - "content": topic_content, - "topicTitle": topic_title, - "mdContent": topic_content, - "communityId": 3597, - "loginUserName": "community_286", - "bizNo": "ebook" - } - - if chapter_code_mapping.get(file) is None: - # resp = post(request_url, send_topic_request_param) - # topic_link = resp['data']['content']['url'] - # chapter_code_mapping[file] = topic_link - # print('{}:{}'.format(file, topic_link)) - print('错误') - else: - send_topic_request_param['id'] = int( - chapter_code_mapping[file].split('/')[-1]) - resp = post(request_url, send_topic_request_param) - print('{}:{}'.format(file, chapter_code_mapping.get(file))) - - save_mapping = json.dumps(chapter_code_mapping, - ensure_ascii=False, - indent=2) - print(save_mapping) - with open(mapping_path, 'w') as f: - f.write(save_mapping) - - -send_topic() \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100644 index db73107..0000000 --- a/main.py +++ /dev/null @@ -1,4 +0,0 @@ -from src.ebook.extract_book_code import extract_code - -if __name__ == "__main__": - extract_code() diff --git a/src/ebook/ebook_get_request.py b/src/ebook/ebook_get_request.py deleted file mode 100644 index 7ae2ce9..0000000 --- a/src/ebook/ebook_get_request.py +++ /dev/null @@ -1,44 +0,0 @@ -import json -import requests -import logging - - -logger = logging.getLogger(__name__) - - -def get_chapter_content(params): - url = 'http://192.168.50.117:9003/v1/chapter/content' - - headers = { - "Cookie":"UserToken=149ba8a7a8d341bbbe41f904c4c9b176;UserName=xiuxiuyayayy" - } - - result = requests.get(url=url, params=params, headers=headers) - - if result.status_code == 200: - ret = json.loads(result.text) - logger.info('request success') - content = ret['data'] - return content - else: - logger.info('request failed!!!!!') - return {} - - -def get_chapter_list(params): - url = 'http://192.168.50.117:9003/inner/v1/chapter/list' - - headers = { - "Cookie":"UserToken=149ba8a7a8d341bbbe41f904c4c9b176;UserName=xiuxiuyayayy" - } - - result = requests.get(url=url, params=params, headers=headers) - - if result.status_code == 200: - ret = json.loads(result.text) - logger.info('request success') - content = ret['data'] - return content - else: - logger.info('request failed!!!!!') - return {} \ No newline at end of file diff --git a/src/ebook/extract_book_code.py b/src/ebook/extract_book_code.py deleted file mode 100644 index 0c4008f..0000000 --- a/src/ebook/extract_book_code.py +++ /dev/null @@ -1,118 +0,0 @@ -import json -import os -import re -import html -from bs4 import BeautifulSoup -from .get_book_chapter_id_list import get_chapter_id_list -from .ebook_get_request import get_chapter_content - - -def extract_code(): - - book_mapping_path = "data/book_mapping.json" - with open(book_mapping_path, "r") as f: - book_mapping = json.load(f) - for book_idx, book_name in enumerate(book_mapping.keys()): - if book_name == 'Python编程无师自通': - continue - book_dir_name = '{}.{}'.format(book_idx + 1, book_name) - book_dir = os.path.join('data/books', book_dir_name) - if not os.path.exists(book_dir): - os.mkdir(book_dir) - print(book_dir_name) - book_id = book_mapping[book_name] - request_get_chapter_id_list_params = {"bookId": book_id, "is_main": 1} - chapter_id_list = get_chapter_id_list( - request_get_chapter_id_list_params) - print(chapter_id_list) - for chapter_id in chapter_id_list: - request_get_chapter_content_params = { - 'bookId': book_id, - 'chapterId': chapter_id - } - chapter_resp = get_chapter_content( - request_get_chapter_content_params) - chapter_name = chapter_resp['name'] - chapter_content = chapter_resp['content'] - try: - if book_name == "零基础学机器学习": - chapter_num = re.findall(r'第(.*)课', chapter_name)[0] - chapter_name_modify = re.sub( - r'第(.*)课', r'第{}课'.format(chapter_num.zfill(2)), - chapter_name) - else: - chapter_num = re.findall(r'第(.*)章', chapter_name)[0] - chapter_name_modify = re.sub( - r'第(.*)章', r'第{}章'.format(chapter_num.zfill(2)), - chapter_name) - chapter_name = chapter_name_modify - except: - # print('该章节没有章节序号: {}'.format(chapter_name)) - pass - chapter_dir = os.path.join(book_dir, chapter_name) - if not os.path.exists(chapter_dir): - os.mkdir(chapter_dir) - # print('创建文件夹: {}'.format(chapter_dir)) - - chapter_content = html.unescape(chapter_content) - - if book_name == "全程软件测试(第3版)": - section_list = re.findall(r'(.*?)', chapter_content) - section_content_list = re.split(r'.*?', - chapter_content, - flags=re.S) - section_dir_list = [] - for section in section_list: - section = section.replace(' ', ' ') - if section.find(r'/') != -1: - section = section.replace('/', '') - section_dir = os.path.join(chapter_dir, section) - print(section_dir) - if not os.path.exists(section_dir): - os.mkdir(section_dir) - section_dir_list.append(section_dir) - for idx, section_content in enumerate(section_content_list): - if idx == 0: - save_dir = os.path.join(chapter_dir, 'text.html') - else: - save_dir = os.path.join(section_dir_list[idx - 1], - 'text.html') - code_list = re.findall(r'(.*?)', - section_content, re.S) - - res_code_list = [] - count = 0 - for i in code_list: - if len(i.split('\n')) < 2: - continue - count += 1 - i = html.unescape(i) - soup = BeautifulSoup(i) - res_str = soup.get_text() - - if idx == 0: - code_save_dir = os.path.join( - chapter_dir, 'code_0.java') - else: - code_save_dir = os.path.join( - section_dir_list[idx - 1], - 'code_{}.java'.format(count)) - - print(res_str) - with open(code_save_dir, 'w', encoding='utf-8') as f: - f.write(res_str) - - # clean_text_list = [] - # for line in res_str.split('\n'): - # if line == '': - # continue - # if line[0].isdigit(): - # line = re.findall(r'^[0-9]+ {0,2}(.*)', - # line)[0] - # # print(line) - # else: - # if line.startswith('>>'): - # break - # clean_text_list.append(line) - # clean_code = '\n'.join(clean_text_list) - # print(clean_code) \ No newline at end of file diff --git a/src/ebook/get_book_chapter_id_list.py b/src/ebook/get_book_chapter_id_list.py deleted file mode 100644 index 6fd1ad5..0000000 --- a/src/ebook/get_book_chapter_id_list.py +++ /dev/null @@ -1,18 +0,0 @@ -import json -import re -import html -import nltk -import html2text -import os -import pandas as pd -from bs4 import BeautifulSoup -from .ebook_get_request import get_chapter_list - - -def get_chapter_id_list(param): - chapter_list = [] - ret = get_chapter_list(param) - for item in ret: - chapterid = item['chapterid'] - chapter_list.append(chapterid) - return chapter_list diff --git a/src/extract/__init__.py b/src/extract/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/extract/extract_e_book_structure.py b/src/extract/extract_e_book_structure.py deleted file mode 100644 index b7b44a2..0000000 --- a/src/extract/extract_e_book_structure.py +++ /dev/null @@ -1,95 +0,0 @@ -import json -import re -import html -import nltk -import html2text -import os -import pandas as pd -from bs4 import BeautifulSoup -from src.extract.get_book_content import get_chapter_content - -def extract_structure(): - params = { - "bookId": "c798a5992a654857867ec15660e1c32a", - } - - book_path = '20211203Python编程无师自通.csv' - - book_data = pd.read_csv(book_path) - - chapterid_list = book_data['chapterid'] - for chapter_id in chapterid_list: - # chapter_id = 87 - params['chapterId'] = chapter_id - res = get_chapter_content(params) - chapter_name = res['name'] - chapter_dir = './test_dir/{}'.format(chapter_name) - try: - chapter_num = re.findall(r'第(.*)章', chapter_dir)[0] - print(chapter_num.zfill(2)) - chapter_dir = re.sub(r'第(.*)章', r'第{}章'.format(chapter_num.zfill(2)), chapter_dir) - print(chapter_dir) - except: - continue - if not os.path.exists(chapter_dir): - os.mkdir(chapter_dir) - content = res['content'] - content = html.unescape(content) - - section_list = re.findall(r'(.*?)', content) - - section_content_list = re.split(r'.*?', content, flags=re.S) - - section_dir_list = [] - for section in section_list: - section_dir = os.path.join(chapter_dir, section) - if not os.path.exists(section_dir): - os.mkdir(section_dir) - section_dir_list.append(section_dir) - # print(section_dir_list) - - for idx, section_content in enumerate(section_content_list): - if idx == 0: - save_dir = os.path.join(chapter_dir, 'text.html') - else: - save_dir = os.path.join(section_dir_list[idx-1], 'text.html') - # with open(save_dir, 'w', encoding='utf-8') as f: - # f.write(section_content) - - code_list = re.findall(r'(.*?)', section_content, re.S) - - res_code_list = [] - - - count = 0 - for i in code_list: - if len(i.split('\n')) < 2: - continue - count+=1 - i = html.unescape(i) - soup = BeautifulSoup(i) - res_str = soup.get_text() - - if idx == 0: - code_save_dir = os.path.join(chapter_dir, 'code_0.py') - else: - code_save_dir = os.path.join(section_dir_list[idx-1], 'code_{}.py'.format(count)) - - clean_text_list = [] - for line in res_str.split('\n'): - if line == '': - continue - if line[0].isdigit(): - line = re.findall(r'^[0-9]+ {0,2}(.*)', line)[0] - # print(line) - else: - if line.startswith('>>'): - break - clean_text_list.append(line) - clean_code = '\n'.join(clean_text_list) - - with open(code_save_dir, 'w', encoding='utf-8') as f: - f.write(clean_code) - - - diff --git a/src/extract/get_book_content.py b/src/extract/get_book_content.py deleted file mode 100644 index 3a3292b..0000000 --- a/src/extract/get_book_content.py +++ /dev/null @@ -1,25 +0,0 @@ -import json -import requests -import logging - - -logger = logging.getLogger(__name__) - - -def get_chapter_content(params): - url = 'http://192.168.50.117:9003/v1/chapter/content' - - headers = { - "Cookie":"UserToken=149ba8a7a8d341bbbe41f904c4c9b176;UserName=xiuxiuyayayy" - } - - result = requests.get(url=url, params=params, headers=headers) - - if result.status_code == 200: - ret = json.loads(result.text) - logger.info('request success') - content = ret['data'] - return content - else: - logger.info('request failed!!!!!') - return {} \ No newline at end of file diff --git a/src/tree.py b/src/tree.py deleted file mode 100644 index 95e1cbc..0000000 --- a/src/tree.py +++ /dev/null @@ -1,296 +0,0 @@ -# -*- coding: utf-8 -*- -import logging -from genericpath import exists -import json -import os -import uuid -import sys -import re - -id_set = set() -logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) -handler = logging.StreamHandler(sys.stdout) -formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') -handler.setFormatter(formatter) -logger.addHandler(handler) - - -def load_json(p): - with open(p, 'r', encoding='utf-8') as f: - return json.loads(f.read()) - - -def dump_json(p, j, exist_ok=False, override=False): - if os.path.exists(p): - if exist_ok: - if not override: - return - else: - logger.error(f"{p} already exist") - sys.exit(0) - - with open(p, 'w+', encoding='utf-8') as f: - f.write(json.dumps(j, indent=2, ensure_ascii=False)) - - -def ensure_config(path): - config_path = os.path.join(path, "config.json") - if not os.path.exists(config_path): - node = {"keywords": []} - dump_json(config_path, node, exist_ok=True, override=False) - return node - else: - return load_json(config_path) - - -def parse_no_name(d): - p = r'(\d+)\.(.*)' - m = re.search(p, d) - - try: - no = int(m.group(1)) - dir_name = m.group(2) - except: - sys.exit(0) - - return no, dir_name - - -def check_export(base, cfg): - flag = False - exports = [] - for export in cfg.get('export', []): - ecfg_path = os.path.join(base, export) - if os.path.exists(ecfg_path): - exports.append(export) - else: - flag = True - if flag: - cfg["export"] = exports - return flag - - -class TreeWalker: - def __init__(self, root, tree_name, title=None, log=None): - self.name = tree_name - self.root = root - self.title = tree_name if title is None else title - self.tree = {} - self.logger = logger if log is None else log - - def walk(self): - root = self.load_root() - root_node = { - "node_id": root["node_id"], - "keywords": root["keywords"], - "children": [] - } - self.tree[root["tree_name"]] = root_node - self.load_levels(root_node) - self.load_chapters(self.root, root_node) - for index, level in enumerate(root_node["children"]): - level_title = list(level.keys())[0] - level_node = list(level.values())[0] - level_path = os.path.join(self.root, f"{index+1}.{level_title}") - self.load_chapters(level_path, level_node) - for index, chapter in enumerate(level_node["children"]): - chapter_title = list(chapter.keys())[0] - chapter_node = list(chapter.values())[0] - chapter_path = os.path.join( - level_path, f"{index+1}.{chapter_title}") - self.load_sections(chapter_path, chapter_node) - for index, section_node in enumerate(chapter_node["children"]): - section_title = list(section_node.keys())[0] - full_path = os.path.join( - chapter_path, f"{index}.{section_title}") - if os.path.isdir(full_path): - self.ensure_exercises(full_path) - - tree_path = os.path.join(self.root, "tree.json") - dump_json(tree_path, self.tree, exist_ok=True, override=True) - return self.tree - - def load_levels(self, root_node): - levels = [] - for level in os.listdir(self.root): - if not os.path.isdir(level): - continue - level_path = os.path.join(self.root, level) - num, config = self.load_level_node(level_path) - levels.append((num, config)) - - levels = self.resort_children(self.root, levels) - root_node["children"] = [item[1] for item in levels] - return root_node - - def load_level_node(self, level_path): - config = self.ensure_level_config(level_path) - num, name = self.extract_node_env(level_path) - - result = { - name: { - "node_id": config["node_id"], - "keywords": config["keywords"], - "children": [], - } - } - - return num, result - - def load_chapters(self, base, level_node): - chapters = [] - for name in os.listdir(base): - full_name = os.path.join(base, name) - if os.path.isdir(full_name): - num, chapter = self.load_chapter_node(full_name) - chapters.append((num, chapter)) - - chapters = self.resort_children(base, chapters) - level_node["children"] = [item[1] for item in chapters] - return level_node - - def load_sections(self, base, chapter_node): - sections = [] - for name in os.listdir(base): - full_name = os.path.join(base, name) - if os.path.isdir(full_name): - num, section = self.load_section_node(full_name) - sections.append((num, section)) - - sections = self.resort_children(base, sections) - chapter_node["children"] = [item[1] for item in sections] - return chapter_node - - def resort_children(self, base, children): - children.sort(key=lambda item: item[0]) - for index, [number, element] in enumerate(children): - title = list(element.keys())[0] - origin = os.path.join(base, f"{number}.{title}") - posted = os.path.join(base, f"{index+1}.{title}") - if origin != posted: - self.logger.info(f"rename [{origin}] to [{posted}]") - os.rename(origin, posted) - return children - - def ensure_chapters(self): - for subdir in os.listdir(self.root): - self.ensure_level_config(subdir) - - def load_root(self): - config_path = os.path.join(self.root, "config.json") - if not os.path.exists(config_path): - config = { - "tree_name": self.name, - "keywords": [], - "node_id": self.gen_node_id(), - } - dump_json(config_path, config, exist_ok=True, override=True) - else: - config = load_json(config_path) - flag, result = self.ensure_node_id(config) - if flag: - dump_json(config_path, result, exist_ok=True, override=True) - - return config - - def ensure_level_config(self, path): - config_path = os.path.join(path, "config.json") - if not os.path.exists(config_path): - config = { - "node_id": self.gen_node_id() - } - dump_json(config_path, config, exist_ok=True, override=True) - else: - config = load_json(config_path) - flag, result = self.ensure_node_id(config) - if flag: - dump_json(config_path, config, exist_ok=True, override=True) - return config - - def ensure_chapter_config(self, path): - config_path = os.path.join(path, "config.json") - if not os.path.exists(config_path): - config = { - "node_id": self.gen_node_id(), - "keywords": [] - } - dump_json(config_path, config, exist_ok=True, override=True) - else: - config = load_json(config_path) - flag, result = self.ensure_node_id(config) - if flag: - dump_json(config_path, config, exist_ok=True, override=True) - return config - - def ensure_section_config(self, path): - config_path = os.path.join(path, "config.json") - if not os.path.exists(config_path): - config = { - "node_id": self.gen_node_id(), - "keywords": [], - "children": [], - "export": [] - } - dump_json(config_path, config, exist_ok=True, override=True) - else: - config = load_json(config_path) - flag, result = self.ensure_node_id(config) - if flag: - dump_json(config_path, config, exist_ok=True, override=True) - return config - - def ensure_node_id(self, config): - if "node_id" not in config: - config["node_id"] = self.gen_node_id() - return True, config - else: - return False, config - - def gen_node_id(self): - return f"{self.name}-{uuid.uuid4().hex}" - - def extract_node_env(self, path): - try: - _, dir = os.path.split(path) - self.logger.info(path) - number, title = dir.split(".", 1) - return int(number), title - except Exception as error: - self.logger.error(f"目录 [{path}] 解析失败,结构不合法,可能是缺少序号") - sys.exit(1) - - def load_chapter_node(self, full_name): - config = self.ensure_chapter_config(full_name) - num, name = self.extract_node_env(full_name) - result = { - name: { - "node_id": config["node_id"], - "keywords": config["keywords"], - "children": [], - } - } - return num, result - - def load_section_node(self, full_name): - config = self.ensure_section_config(full_name) - num, name = self.extract_node_env(full_name) - result = { - name: { - "node_id": config["node_id"], - "keywords": config["keywords"], - "children": config.get("children", []) - } - } - # if "children" in config: - # result["children"] = config["children"] - return num, result - - def ensure_exercises(self, section_path): - config = self.ensure_section_config(section_path) - for e in config.get("export", []): - full_name = os.path.join(section_path, e) - exercise = load_json(full_name) - if "exercise_id" not in exercise: - exercise["exercise_id"] = uuid.uuid4().hex - dump_json(full_name, exercise) -- GitLab