Prodesire's recent timeline updates
Prodesire's repos on GitHub
Batchfile · 4427 watchers
Python-Guide-CN
Python最佳实践指南。 The chinese translation of "Hitchhiker's Guide to Python".
Python · 73 watchers
face-mask
Wear face masks in the given picture.
Python · 44 watchers
py-libterraform
Python binding for Terraform.
Python · 20 watchers
MemLite
A fast, pure-Python, untyped, in-memory database engine, using Python syntax to manage data, instead of SQL, inspired by PyDbLite.
Python · 20 watchers
terminal-proxy
Proxy management tool for terminal.
Python · 8 watchers
github-to-dingtalk
An implementation of webhook used to notify GitHub repository events to DingTalk.
Python · 6 watchers
chpip
A tool to manage the base URL of the Python package index.
2 watchers
PyCon-China-2019-Survey
中国 Pythonista 现状(2019)调研:聊聊你和 Python 的那些事儿?
C · 1 watchers
Link-Load-Lib
程序员的自我修养——链接、装载与库
Python · 0 watchers
Algorithm
0 watchers
Antigravity-Manager
Professional Antigravity Account Manager & Switcher. One-click seamless account switching for Antigravity Tools. Built with Tauri v2 + React (Rust).专业的 Antigravity 账号管理与切换工具。为 Antigravity 提供一键无缝账号切换功能。
0 watchers
awesome-mojo
A curated list of awesome Mojo 🔥 frameworks, libraries, software and resources
0 watchers
mojo
The Mojo Programming Language
0 watchers
morrow.mojo
Human-friendly date & time for Mojo 🔥
0 watchers
Prodesire
Stylus · 0 watchers
prodesire.github.io
Prodesire's Personal Website
Batchfile · 0 watchers
python-guide
Python best practices guidebook, written for Humans.
Prodesire

Prodesire

V2EX member #275117, joined on 2017-12-17 18:48:59 +08:00
Prodesire's recent replies
点赞支持!
支持,期待!
Jul 24, 2018
Replied to a topic by Prodesire Python [HZPUG] Python 演讲主题征集问卷调查
up
期待!
欢迎大家前来交流!
@xpresslink 我觉得类似 1 和 1.0 我们通常可以认为是一样的,那么不论是 set 还是 dic.fromkeys 的结果都可以接受。
如果说非要区分的话,倒是可以对 int, float, decimal.Decimal 做特殊处理。
@Arnie97 感谢斧正!
pydu.cmd.terminate→os.kill #terminiate 在 windows 上的处理调用了 Win32API,会更加靠谱
pydu.console.console_size→shutil.get_terminal_size #这个还真是
pydu.exception.ignore→contextlib.suppress #这个还真是,Py2 上倒是可以参考实现了
pydu.misc.copy→shutil.copytree #pydu 的 copy 更加上层,不用区分拷贝对象是文件还是文件夹,类似 Linux 上的 cp
pydu.network.dotted_netmask→ipaddress # 确实是这样,Python3 新增的 ipaddress 解决了相关问题,dotted_netmask 算是 py2 上的补充吧。这段代码更大的意义是学习背后的实现,来自 requests 库。
@est 3.6 中倒没有反例。如 @xpresslink 所说,官方并不推荐这么做。

有一点你可能没有注意到,pydu 中的 uniq 还有一个参数是 key,举个例子:
class A(object):
def __init__(self, v):
self.v = v
def __repr__(self):
return 'A({})'.format(self.v)

l = [A(2), A(1), A(2)]
uniq(l, key=lambda o: o.v) # 结果是 [A(2), A(1)]
list(dict.fromkeys(l)) # 结果是 [A(2), A(1), A(2)],原因大家都知道,列表中都是不同对象,我们需要对比的是 v,但是没办法做到
@mingyun @DeTamble 已修复在 Windows 上使用 Python 3 安装的问题,见 pydu 0.3.1 版本
@xpresslink 这点赞同!
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3258 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms · UTC 10:50 · PVG 18:50 · LAX 03:50 · JFK 06:50
♥ Do have faith in what you're doing.