如何用pylab绘制一颗心?我用谷歌搜索绘制图片的方法,但我想知道如何用pylab绘制它.有人可以帮忙吗?图片应如下所示:
我知道我可以像以下一样获得进程的stdin
使用子进程python
:
import subprocess
f = subprocess.Popen('python example.py',stdin=subprocess.PIPE)
f.stdin.write('some thing')
Run Code Online (Sandbox Code Playgroud)
但我只想知道我要写入流程的pid我该stdin
怎么做?
我有添加一些错误task
的celery
使用Redis的broker
但现在我想删除不正确的task
,我找不到任何方法来做到这一点
是否有一些命令或一些api这样做?
正如我在python中所知道的,我可以将列表设置为一个唯一的列表,如:
In [12]: a=range(12)
In [13]: a.append(5)
In [14]: a.append(4)
In [15]: a.append(5)
In [16]: a
Out[16]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 5, 4, 5]
In [17]: set(a)
Out[17]: set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
Run Code Online (Sandbox Code Playgroud)
它对某些场景非常有用,我只是想知道如何在javascript中,
我使用django运行我的网站和nginx用于前端网络服务器,
但是当我将一个非常大的文件上传到我的网站时,
我需要很长时间
当nginx手上传大文件时有些问题;
收到我所有的帖子文件后,nginx会将文件发送到django;
所以这将花费我更多的时间;
我想找一些其他的webserver来取代nginx;
祝你的建议?
我正在使用brew安装一些软件,当我尝试安装软件时,我得到了这个:
localhost:~ timger$ brew install autoconf
Error: No available formula for autoconf
localhost:~ timger$ brew install automake
Error: No available formula for automake
localhost:~ timger$ brew install libtool
Error: No available formula for libtool
localhost:~ timger$ brew install pkg-con
Run Code Online (Sandbox Code Playgroud) 有一些人吗?我有一些关于wxpython的问题,我可以使用没有框架的面板吗?
我知道django有一些缓存方法,如每站点缓存,每视图缓存,指定每视图缓存和模板片段缓存但这些缓存之间有什么区别?每站点缓存意味着缓存系统缓存整个站点?我怎么能理解'缓存整个网站'这个词?
我想test
在发现这样的异常时多次执行一个函数
try:
test()
except:
try:
test()
except:
try:
test()
except Exception,e:
logger.info(e)
Run Code Online (Sandbox Code Playgroud)
这种情况下,当我请求一个url并获取url响应时,
因为当你只请求一次时,目标Web服务器可能会响应一些不良数据,
那么这么多单词要做到这一点,而不是pythonic实现
是否有一些pythonic样式来执行此操作?
我使用xcode4开发一个基本地图应用程序,我设置一个区域使用MKCoordinateRegionMakeWithDistance
如下:
self->map.hidden=NO;
CLLocationCoordinate2D loc = CLLocationCoordinate2DMake([[NSNumber numberWithFloat:34.923964] doubleValue],[[NSNumber numberWithFloat:-120.219558] doubleValue]);
NSLog(@"%f",[[NSNumber numberWithFloat:34.923964] doubleValue]);
MKCoordinateRegion reg = MKCoordinateRegionMakeWithDistance(loc,[[NSNumber numberWithFloat:1000] doubleValue],[[NSNumber numberWithFloat:1000] doubleValue]);
self->map.region = reg;
当我试图对我写的东西进行测试时,我得到了这样的信息:
Undefined symbols for architecture armv7:
"_CLLocationCoordinate2DMake", referenced from:
-[MapViewController viewDidAppear:] in MapViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
消息是什么意思?