• 大小: 2.86MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-11
  • 语言: 其他
  • 标签: Swift语言  中文版  

资源简介

《Swift语言》中文版API

资源截图

代码片段和文件信息

#!/usr/bin/python
# coding:utf-8


import os


def iter(path):
    for root dirs files in os.walk(path):
        for fn in files:
            if fn.endswith(“.html“):
                with open(root + ‘/‘ + fn ‘r‘) as f:
                    content = f.read()
                content = content.replace(‘ript src=“https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js“>ript>‘ ‘ript src=“http://cdn.bootcss.com/ace/1.1.3/ace.js“>ript>‘).replace(‘ript src=“https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js“>ript>‘ ‘ript src=“http://cdn.bootcss.com/ace/1.1.3/mode-javascript.js“>ript>‘)
                insert_pos = content.find(““ content.find(“Generated using GitBook“)) + 6
                content = content[:insert_pos] + ‘‘‘yle=“margin-left:15%;“> rame  src=“http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large“
  allowtransparency=“true“ frameborder=“0“ scrolling=“0“ width=“170“ height=“30“>
rame>‘‘‘ + content[insert_pos:]
                content.replace(r‘tle>.*?tle>‘ “tle>《The Swift Programming Language》完整中文版tle>“)
                with open(root + ‘/‘ + fn ‘w‘) as f:
                    f.write(content)

iter(os.getcwd())

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\
     文件          17  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\CNAME
     文件        4521  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\README.md
     目录           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\
     目录           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\02Interoperability\
     文件        3726  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\02Interoperability\01Interacting with objective-C APIs.md
     目录           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\03Mix and Match\
     文件       25673  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\03Mix and Match\DAG_2x.png
     文件           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\03Mix and Match\Swift and objective-C in the Same Project.md
     文件       90275  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\Using Swift with Cocoa and objectiveC\03Mix and Match\bridgingheader_2x.png
     文件        1314  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\change_cdn.py
     目录           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter1\
     文件       26836  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter1\01_swift.html
     文件       53334  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter1\02_a_swift_tour.html
     文件       24645  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter1\chapter1.html
     目录           0  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\
     文件       65854  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\01_The_Basics.html
     文件       46148  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\02_Basic_Operators.html
     文件       46496  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\03_Strings_and_Characters.html
     文件       49080  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\04_Collection_Types.html
     文件       70515  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\05_Control_Flow.html
     文件       56898  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\06_Functions.html
     文件       46304  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\07_Closures.html
     文件       39367  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\08_Enumerations.html
     文件       52198  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\09_Classes_and_Structures.html
     文件       48452  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\10_Properties.html
     文件       42319  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\11_Methods.html
     文件       33897  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\12_Subscripts.html
     文件       41610  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\13_Inheritance.html
     文件       65410  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\14_Initialization.html
     文件       31756  2014-06-13 04:35  the-swift-programming-language-in-chinese-gh-pages\chapter2\15_Deinitialization.html
............此处省略122个文件信息

评论

共有 条评论