Giter Site home page Giter Site logo

notes-python's Issues

拼写小错误

02.05 使用0-base的使用

“Just to beautiful to ignore.
----Guido van Rossum”

Just to ==> Just too

Update

大哥,感觉您这个真的不错,也知道您出版相应的中文书了。但是吧希望大哥您在百忙之中,更新一版吧,更新到Python3吧。

04.09公式输入错误

第393行的矩阵求解缺少换行,
但是我怎么捣鼓也不对hhhh,求大神指教,谢谢!

在windows下生成静态文件会报错

第一个错误:

.\notes-python\generate_static_files.py in convert_to_files(names, to_format)
     68         p = converter[to_format](file_name)
     69         with open(os.path.join(target_dir, file_name[:-6] + p[1]["output_extension"]), 'w',encoding='utf8') as f:
---> 70             f.write(p[0].encode('utf8'))
     71         print(file_name)
     72

TypeError: write() argument must be str, not bytes

很明显,第70行有错误,f.write()只能写入字符串,应该改为f.write(p[0])

第二个错误

第二个错误是windows的问题,在windows下,默认的编码是cp936,也就是GBK,此时若不指定编码,python使用open()函数打开文件则默认为cp936,这显然是错误的,所以在使用open()打开文件时,应该指定编码,即

open(os.path.join(target_dir, file_name[:-6] + p[1]["output_extension"]), 'w', encoding='utf8') #69行
open('index.md' ,'r',encoding='utf8') #85行
open(os.path.join("static-files", "html", "README.md"), "w",encoding='utf8') #87行

How to convert this repo to a book/pdf

I find that nbviewer.jupyter.org can convert .jpynb to html, but it only support single jpynb file. So how can I convert the whole repo into a pdf which is more easy to read.

list和tuple的遍历速度问题

In [4]:
%timeit for row in lst: list(row)
100 loops, best of 3: 4.12 ms per loop
In [5]:
%timeit for row in tup: tuple(row)
100 loops, best of 3: 2.07 ms per loop

这个地方有个疑问,我理解的话,这里差距的产生和list(row)与tuple(row)的速度有关吧?实际遍历的速度应该是差不多吧

typo

os.path.slitext(path):将路径与扩展名分开

os.path.splitext(path):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.