FreeBTC123's recent timeline updates
FreeBTC123

FreeBTC123

V2EX member #52072, joined on 2013-12-17 15:57:17 +08:00
FreeBTC123's recent replies
Nov 29, 2016
Replied to a topic by pppy Python 获取下个周三的日期
```python
In [13]: def coming_weekday(num):
this_week = Week.thisweek()
return (this_week + (not this_week.day(num) > datetime.now().date())).day(num)
....:
```
Nov 29, 2016
Replied to a topic by pppy Python 获取下个周三的日期
```python
In [1]: from datetime import datetime

In [2]: from isoweek import Week

In [3]: def coming_weekday(num):
...: this_week = Week.thisweek()
...: this_weekday = this_week.day(num)
...: return this_weekday if this_weekday > datetime.now().date() else (this_week + 1).day(num)
...:

In [4]: coming_weekday(2)
Out[4]: datetime.date(2016, 11, 30)

In [5]: # 0 is Monday
```
Nov 29, 2016
Replied to a topic by pppy Python 获取下个周三的日期
囧, 搞成下周的周三了
Nov 29, 2016
Replied to a topic by pppy Python 获取下个周三的日期
* 安装
```shell
pip install isoweek
```

* 使用
```python
In [1]: from isoweek import Week

In [2]: (Week.thisweek() + 1).wednesday()
Out[2]: datetime.date(2016, 12, 7)
```
Jun 12, 2016
Replied to a topic by cxz Python 弱弱问一个 python 操作 sqlite 的问题
https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.execute

```
execute(sql[, parameters])
This is a nonstandard shortcut that creates an intermediate cursor object by calling the cursor method, then calls the cursor ’ s execute method with the parameters given.
```
雇人做个小游戏, 一旦火爆了, 流量杠杠的
forms不仅仅能拿数据, 还能校验数据的哦,tornado 想用的话, 推荐[WTForms](http://tt4it.com/resources/discuss/1599/)
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: timeit sum(xrange(1, 1000000001))
1 loops, best of 3: 9.26 s per loop

In [2]:
Jul 11, 2014
Replied to a topic by gangsta 设计 关于用视频做网页背景
@FreeBTC123 http://pamjs.com/pam/mov/ 视频加载慢也是一个很大的问题啊, 也得想办法解决一下
Jul 11, 2014
Replied to a topic by gangsta 设计 关于用视频做网页背景
自己写的, 非前端码农, 写的貌似有点烂, 有空还会继续加东西, 欢迎大家共同开发啊。。。 http://tt4it.com/resources/discuss/281/
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5934 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 41ms · UTC 06:55 · PVG 14:55 · LAX 23:55 · JFK 02:55
♥ Do have faith in what you're doing.