liuguichao's recent timeline updates
liuguichao

liuguichao

V2EX member #325316, joined on 2018-06-28 10:51:33 +08:00
liuguichao's recent replies
这么好的机会,没人关注?
全日制硕士,应该超过要求了! 但是个别公司就是这样,看第一学历,有点要求 211/985 本科,这个没办法,换别的公司就是了。
result_proxy = self.execute(sql, args)
id = result_proxy.lastrowid
方案一: 跨平台
APScheduler 可以用来写调度
https://pypi.org/project/APScheduler/
方案二: linux crontab
直接编辑配置文件即可满足要求
Aug 1, 2019
Replied to a topic by liuguichao Python 字符串长度与数据库字符串长度不一样
@xpresslink 多谢!
总结一下:
使用 s.encode('string_escape')和 s.encode('unicode-escape'),可以获取 raw string,再取 len 就可以获得期望的字节长度。
需要注意的事项: 数据库中的 char(n)/varchar(n)/nchar(n)/nvarchar(n), n 指的是字符串的字节码表示长度,不是字符串的长度。
有必要
Note that a daemonic process is not allowed to create child processes. Otherwise a daemonic process would leave its children orphaned if it gets terminated when its parent process exits. Additionally, these are not Unix daemons or services, they are normal processes that will be terminated (and not joined) if non-daemonic processes have exited.
还有一种可能,遍历 ResultProxy 记录之前,需要先判断一下是否有返回行,直接 for 遍历会出错。
https://docs.sqlalchemy.org/en/13/core/connections.html?highlight=resultproxy#sqlalchemy.engine.ResultProxy.returns_rows

returns_rows
True if this ResultProxy returns rows.
I.e. if it is legal to call the methods fetchone(), fetchmany() fetchall().
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   751 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 21:19 · PVG 05:19 · LAX 14:19 · JFK 17:19
♥ Do have faith in what you're doing.