V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  aec4d  ›  全部回复第 17 页 / 共 28 页
回复总数  553
1 ... 13  14  15  16  17  18  19  20  21  22 ... 28  
2015-08-04 16:21:12 +08:00
回复了 xiaobetty 创建的主题 推广 晒出你最蠢的一段代码,送 Cherry 鼠标垫
def foo(number):
for x in range(2, number):
if not number % x:
return False
if number > 2:
return True


def bar(number):
return filter(foo, range(1, number))


print(list(bar(20000)))
大概是这样子的
2015-07-31 14:50:03 +08:00
回复了 realpg 创建的主题 奇思妙想 谁能给电视机开发一个去广告功能。。。
非常喜欢楼主的这个点子 想法真赞!!! 其实屏蔽了可以换成其他的视频放上去啊 同样是看的广告 创意广告何其多 甚至可以一直不重样 如果是我 我会选择屏蔽广告的那段时间放一些外国的创意广告(视频) 甚至于电视剧看烦了切到广告看看 同时还能听听英语 岂不乐乎
只是想要把它做成一门生意。。。。特么的有广电总局╭(╯^╰)╮
2015-07-22 17:21:49 +08:00
回复了 Freedom1 创建的主题 问与答 新人求助关于 pyqt
先用QtDesinger绘制一个界面 然后用pyuic5转换成py文件
然后是使用QFileDialog选择文件
大概代码是这样
filters = "Excel (*.xls *.xlsx)"
browse.getOpenFileName(self, 'Select Files', QDir.currentPath(), filters)[0]
directory = browse.getExistingDirectory(self, "Select Files", QDir.currentPath())
然后保存用shutil.copyfile?
2015-07-21 11:15:48 +08:00
回复了 Shintaku 创建的主题 Apple 入手 MacBook Pro with Retina 内存硬盘如何权衡
OSX上16G的内存效果和WIN上4G的差不了多少,个人感受
2015-07-15 22:42:11 +08:00
回复了 sbmzhcn 创建的主题 Python python 多线程在 while True:里的操作方式
想到一个笑话 一个50行的程序大家都会来指指点点 一个500行的程序大家都会说好好好~~
估计楼主最开始不是写python的
这应该是一个生产者消费者模型,使用一个线程不断的查询可以注册的域名 添加到Queue队列,然后消费者线程不断的循环 就能后在queuq有数据的时候消耗掉它
thread <ParseCommand(Thread-85, initial)> 会不停的从Thread-1增加
至于这里
self.workers.qsize()返回的总是2 然后你每次从queue中get一个出来之后都会在put一个进去一模一样的,当然会不间断的死循环了
这个例子比较有趣~~
http://stackoverflow.com/questions/20783337/concurrent-futures-usage-guide-a-simple-example-of-using-both-threading-and-pr
2015-07-15 00:48:37 +08:00
回复了 RIcter 创建的主题 天黑以后 20150715 午夜俱乐部
PYQT有趣也伴随着折磨T_T
我也搜了好久。。。搜索 所有人 支持分页 就可以找到了
http://lax.v2ex.com/t/173440
2015-07-13 10:28:03 +08:00
回复了 heaton_nobu 创建的主题 Python 请问 lxml 的正确安装方式应该是怎样?
装这个确实麻烦 装多了 装烦了就做了个记录。。。
https://gist.github.com/Ficapy/bfbaf37fabc66cc807c9
https://gist.github.com/Ficapy/08b0000d73e9cb019e25
win上最简单的办法就是6楼 ubuntu上最简单的办法就是sudo apt-get build-dep -y python-lxml
2015-07-13 09:11:24 +08:00
回复了 pythonee 创建的主题 深圳 深夜牙痛怎么办
十多年牙痛患者告诉你。。。。现在不要怕花钱 赶紧去正规的牙科医院 越拖延越严重耗费的资金越大
2015-07-12 16:11:44 +08:00
回复了 gaotongfei 创建的主题 Python 推荐一个关于 Python 的 Podcast, Talk Python To Me
还写过使用transcription生成Lrc的脚本....不知道现在还能不能正常用~~
https://github.com/Ficapy/single/blob/master/talkpythontome.py
2015-07-12 10:56:41 +08:00
回复了 razios 创建的主题 分享发现 office365 家庭高级版只要 66 元
如果每年都可以以这个价格续费就好了
2015-07-10 14:12:32 +08:00
回复了 darkmatter 创建的主题 Python 自学 Python 找工作, Python 需要掌握到什么程度?
@JakeWendao 你这不是没头像的默认头像状态么
2015-07-10 13:05:12 +08:00
回复了 darkmatter 创建的主题 Python 自学 Python 找工作, Python 需要掌握到什么程度?
本来想说说的 看到头像呵呵了
2015-07-08 11:53:17 +08:00
回复了 zippera 创建的主题 程序员 关于双层代理上网的问题?
https://github.com/formencode/formencode 用的这个 感觉不是很好用-_-
可以自己写规则,当然也内置了很多规则
应该有更好的方案吧
2015-07-07 22:06:43 +08:00
回复了 latteczy 创建的主题 Python Python 多线程问题
这TM关GIL毛事 简直躺枪
要记住 断然给你提GIL的 要么是高手 要么是SB 有GIL还有multiprocessing呢 多线程最需要注意的应该是线程安全
这是threading.join的文档
join([timeout])
Wait until the thread terminates. This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception – or until the optional timeout occurs.

When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call isAlive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.

When the timeout argument is not present or None, the operation will block until the thread terminates.

A thread can be join()ed many times.

join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.

看了之后你就发现 在上面加上t.join就和下面遍历的写法实质上是一模一样的.
一般网上很多教程给你加上setDaemon 加上join 你可以试着不加看是什么样的。等你熟悉了之后你就晓得那时候该用这些 哪时候不该用
1 ... 13  14  15  16  17  18  19  20  21  22 ... 28  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4975 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 56ms · UTC 08:57 · PVG 16:57 · LAX 01:57 · JFK 04:57
Developed with CodeLauncher
♥ Do have faith in what you're doing.