V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  liuguichao  ›  全部回复第 1 页 / 共 1 页
回复总数  13
这么好的机会,没人关注?
全日制硕士,应该超过要求了! 但是个别公司就是这样,看第一学历,有点要求 211/985 本科,这个没办法,换别的公司就是了。
result_proxy = self.execute(sql, args)
id = result_proxy.lastrowid
方案一: 跨平台
APScheduler 可以用来写调度
https://pypi.org/project/APScheduler/
方案二: linux crontab
直接编辑配置文件即可满足要求
2019-08-01 13:37:56 +08:00
回复了 liuguichao 创建的主题 Python 字符串长度与数据库字符串长度不一样
@xpresslink 多谢!
总结一下:
使用 s.encode('string_escape')和 s.encode('unicode-escape'),可以获取 raw string,再取 len 就可以获得期望的字节长度。
需要注意的事项: 数据库中的 char(n)/varchar(n)/nchar(n)/nvarchar(n), n 指的是字符串的字节码表示长度,不是字符串的长度。
2019-07-16 13:01:14 +08:00
回复了 miniyao 创建的主题 Python Flask-SQLAlchemy 用 db.session.commit() 失败之后,事务会自动回滚吗?
有必要
2019-07-03 10:01:08 +08:00
回复了 zgcwkj 创建的主题 数据库 大伙们设计数据库是怎么设计的呢?
定长字符串,适合存储 MD5/SHA256,对于需要经常变更的数据,不容易产生碎片;变长字符串,如果频繁的更新,列数据变长的情况下数据行会变长,可能需要调整页数据,甚至分裂页。出现额外的操作,就意味着性能损失。
对于变长字符串 varchar(10)和 varchar(100), 虽然使用的硬盘存储空间一样,但是在内存中进行排序时消耗却不同。
2019-07-03 09:42:03 +08:00
回复了 jibabi 创建的主题 Python 求助 Python multiprocessing 守护进程为什么不允许有子进程?
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.
2019-06-05 17:45:02 +08:00
回复了 duyuyouci 创建的主题 Python 使用 sqlalchemy 和 celery 异步处理数据库查询时,时不时会报错
还有一种可能,遍历 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().
2019-06-05 13:32:34 +08:00
回复了 duyuyouci 创建的主题 Python 使用 sqlalchemy 和 celery 异步处理数据库查询时,时不时会报错
2019-05-30 15:05:30 +08:00
回复了 wikinee 创建的主题 Python subprocess 后遗症
pgid = os.getpgid(self.proc.pid)
os.killpg(pgid, signal.SIGTERM)
2019-05-30 14:04:15 +08:00
回复了 hughooz 创建的主题 Python 请教下各位, redis 如何遍历出全部的键值对
ns_keys = "kwd:*"
cursor = '0'
while cursor != 0:
cursor, keys = redis_conn.scan(cursor=cursor, match=ns_keys, count=100)
2018-07-05 09:30:16 +08:00
回复了 LeCent 创建的主题 Python 像这样的文章要怎么爬取?
定位 html 标记,使用 xpath 提取 option value。

<select id="archives-dropdown-2" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">

<option value="">選擇月份</option>
<option value="http://www.sandeechan.com/blog/?m=201103"> 2011 年 三月 &nbsp;(31)</option>
<option value="http://www.sandeechan.com/blog/?m=201102"> 2011 年 二月 &nbsp;(28)</option>
<option value="http://www.sandeechan.com/blog/?m=201101"> 2011 年 一月 &nbsp;(31)</option>
<option value="http://www.sandeechan.com/blog/?m=201012"> 2010 年 十二月 &nbsp;(31)</option>

</select>
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2951 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms · UTC 13:07 · PVG 21:07 · LAX 06:07 · JFK 09:07
Developed with CodeLauncher
♥ Do have faith in what you're doing.