这里是EastLakeSide社区😄, 我们首次召集在一起,是为了一起做点作品,于是为社区贡献一本良心译作:《Python进阶》,期间收到了非常多的社区网友的帮助,所以我们本着从社区来到社区去的理念,会持续输出更多良心作品,一起学习成长,帮助每个人进步🌟。
主要发起人和组织者:
感谢社区贡献者: 名单会永远记录在每个repo的contributor列表里。
📘《Python进阶》(Intermediate Python - Chinese Version)
Home Page: https://py.eastlakeside.cn
License: Apache License 2.0
这里是EastLakeSide社区😄, 我们首次召集在一起,是为了一起做点作品,于是为社区贡献一本良心译作:《Python进阶》,期间收到了非常多的社区网友的帮助,所以我们本着从社区来到社区去的理念,会持续输出更多良心作品,一起学习成长,帮助每个人进步🌟。
主要发起人和组织者:
感谢社区贡献者: 名单会永远记录在每个repo的contributor列表里。
python学习手册第五版中文怎么没有
你好在有开梯子的情况下 https://py.eastlakeside.cn/ 链接打不开
一些v2ex网友(@nightv2 )反馈,github直接阅读时,想增加回到目录的链接。
这个需要参考下别的github书籍来改进一下, 一个可改进的就是,
我们的一些小节非常短,可以合并成一个大节,这样就可以减少翻页和回到目录的需求
甚至,可以合成一个超大单页书
列表并行排序,原来的代码
data = zip(list1, list2)
data.sort()
list1, list2 = map(lambda t: list(t), zip(*data))
python3中报错:
AttributeError: 'zip' object has no attribute 'sort'
应该改为
data = zip(list1, list2)
data = sorted(data)
list1, list2 = map(lambda t: list(t), zip(*data))
这是因为在python2中zip()返回的是list类型,而在python3中返回的是zip类型(一种可迭代类型),所以不能用sort(),而应该改为sorted()。
P.S. 原库 intermediatePython 目前也有这个问题
在SUMMARY.dm文件中,目录最后的推荐阅读(https://github.com/eastlakeside/interpy-zh/blob/master/SUMMARY.md )中, Learn Python the Hard Way的那个链接已经失效啦,详见:
https://github.com/eastlakeside/interpy-zh/blob/master/seealso.md
广告内容,已删除
RT
打算做一个所有代码的2.7版本,有需要吗?
less_than_zero = list(filter(lambda x: x < 0, number_list))
filter本身会生成一个列表,是否可以去掉list
加个微信好友可好。 mcx1469
在定义Iterable或Iterator的含义时,直接按照英文的顺序翻译过来效果并不好,中文会让人理解错误。
原文:
一个迭代器是任意一个对象,只要它定义了一个next(Python2) 或者next方法。
建议:
任意一个对象,只要定义了next(Python2) 或者next方法,它就是迭代器。
在 “open函数” 章节里有一处错误语句:“对于计算机来说,所有的问题件都是字节”。
正确句子应该是 “对于计算机来说,所有的文件都是字节”。
由v2ex网友glumes提出:
python 新手,想用 python 做一些更炫的事情的话,大多要导入其他模块吧。
所以,楼主能给些建议如何去知道了解有第三方模块,以及学习掌握他们呢?
运行代码:
email_logit._logfile = 'out3.log' # 如果需要修改log文件参数
@email_logit
def myfunc2():
pass
myfunc2()
错误如下:
TypeError Traceback (most recent call last)
/tmp/ipykernel_74/2250255109.py in
1 email_logit._logfile = 'out3.log' # 如果需要修改log文件参数
2 @email_logit
----> 3 def myfunc2():
4 pass
5/tmp/ipykernel_74/2465603354.py in init(self, email, *args, **kwargs)
5 def init(self, email='[email protected]',*args, **kwargs):
6 self.email = email
----> 7 super(email_logit, self).init(*args, **kwargs)
8
9 def notify(self):TypeError: init() missing 1 required positional argument: 'func'
我进行了修改,修改后的email_logit代码如下:
class email_logit(logit):
'''
一个logit的实现版本,可以在函数调用时发送email给管理员
'''
def __init__(self, func, email='[email protected]',*args, **kwargs):
self.email = email
super(email_logit, self).__init__(func,*args, **kwargs)
def notify(self):
# 发送一封email到self.email
# 这里就不做实现了
print("Send email!")
pass
再次运行后结果如下:
myfunc2 was called
Send email!
注解 对基于生成器的协程的支持 已弃用 并计划在 Python 3.10 中移除。
https://docs.python.org/zh-cn/3/library/asyncio-task.html#generator-based-coroutines
gitee 速度很不错,《Docker —— 从入门到实践》 已经托管到码云。
int n;
char *s;
PyObject* list;
PyArg_ParseTuple(args, "siO", &n, &s, &list);
PyArg_ParseTuple(args, "siO", &n, &s, &list);
中 &n
与 &s
的顺序写反了。
应为
int n;
char *s;
PyObject* list;
PyArg_ParseTuple(args, "siO", &s, &n, &list);
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.