我想找查找朋友位置的app手机上有这种软件吗?

文章数:57
评论数:32
访问量:43098
注册日期:
阅读量:1297
阅读量:3317
阅读量:436823
阅读量:1123926
51CTO推荐博文
pyinstaller,打包python源代码,成为linux/windows下可执行文件,多平台下载:http://www.pyinstaller.org/static/http://www.pyinstaller.org/static/source/1.5/linux用这个:http://www.pyinstaller.org/static/source/1.5/pyinstaller-1.5.tar.bz2windows用这个:http://www.pyinstaller.org/static/source/1.5/pyinstaller-1.5.zip下载后解压就可,不需要安装!& & & & & & & & & & & & & & & & & & &windows下的使用方法:1、首先进入cmd命令行下执行:python C:/pyinstaller-1.5/configure.py(这一步是配置pyinstaller)特别注意:windows下可能会报xxx file or 目录不存在,这时候把他报错的文件给他建立出来,就能通过了02、然后用cmd cd命令到你的.py程序所在的目录下。03、执行:python C:/pyinstaller-1.5/Makespec.py 你的程序名.py --onefile --windowed(参数onefile表示只生成一个文件,有些打包会生成一个exe,以及多个文件;参数windowed表示制作的是一个Windows程序;)04、这时我们可以看到提示:now run Build.py to build the executable意思是可以创建exe程序了。这时我们可以在目录下看到“你的程序名.spec”文件。(如果你感兴趣的话,可以用记事本打开这个文件,看看其中的内容)(只要你不改文件名,而只给了python文件的内容,那么下一次不用再生成.spec文件)生成exe文件:01、运行:python C:/pyinstaller-1.5/build.py 你的程序名.spec等几秒或十几秒。02、得到你的程序名.exe了。(最好在各个平台下都试验一下)(我们还得到了一个目录:buildSlotto;和一个文件:warnSlotto.txt;基本上没什么用,不用关心,除非出错) 结论:我是在win7 64位下编译的,只能在win7 64位运行,应该是由于一般系统是向下兼容的。大家可以在32位或者xp中编译试试& & & & & & & & & & & & & &linux下的使用方法1、下载后,解压到一个位置2、进入到你的代码位置3、命令和windows下一样,注意指定好路径就可以了4、大小和windows下也差不多结论:我是在 centos 32位下编译的,能在32和64位运行64位上跑时,会报ERROR: ld.so: object '/usr/local/lib/snoopy.so' from /etc/ld.so.preload cannot be preloaded: ignored. 不过服务还能正常用。。。不过还能正常使用。总的来说,还不错!windows下打包的后叫:你的程序名.exelinux下打包的后叫:你的程序名 相当于,最终产生了这么一个命令。放在其他linux上时,要chmod +x&给他执行权限
了这篇文章
类别:┆阅读(0)┆评论(0)帐号:密码:下次自动登录{url:/nForum/slist.json?uid=guest&root=list-section}{url:/nForum/nlist.json?uid=guest&root=list-section}
贴数:3&分页:xXx发信人: formydream (xXx), 信区: Python
标&&题: python程序用pyinstaller打包成exe,怎么取消print输出
发信站: 水木社区 (Fri Nov 14 19:16:42 2014), 转信 && 一个没有界面的程序,很多print 语句,想打包成exe文件,但是不想在运行时输出print的内容。
-- && ※ 来源:·水木社区 ·[FROM: 119.99.158.*]
肥了,又肥了 &&&_&&&发信人: milksea (肥了,又肥了 &&&_&&&), 信区: Python
标&&题: Re: python程序用pyinstaller打包成exe,怎么取消print输出
发信站: 水木社区 (Fri Nov 14 19:23:59 2014), 转信 &&
&& -w, --windowed, --noconsole &&&&&&&&&& On Windows and Mac OS X, do not create a console window at run time for standard input/output. (This option is ignored for other operating systems.) On Mac OS X, this option triggers the creation of an OS X application bundle. && 【 在 formydream (xXx) 的大作中提到: 】
: 一个没有界面的程序,很多print 语句,想打包成exe文件,但是不想在运行时输出print的内容。
世界上有 10 种人:懂 10 进制的和不懂 10 进制的。 &&&& ※ 来源:·水木社区 newsmth.net·[FROM: 124.205.77.*]
老鱼发信人: hgoldfish (老鱼), 信区: Python
标&&题: Re: python程序用pyinstaller打包成exe,怎么取消print输出
发信站: 水木社区 (Sat Nov 15 00:21:31 2014), 转信 && 把 sys.stdout 改掉也行。 && 【 在 formydream (xXx) 的大作中提到: 】
: 一个没有界面的程序,很多print 语句,想打包成exe文件,但是不想在运行时输出print的内容。
灭绝人性啊 &&&& ※ 来源:·水木社区 newsmth.net·[FROM: 27.149.193.*]
文章数:3&分页:19:42 提问
为什么在pyinstaller打包运行正常的.py文件为exe文件后,exe文件运行报错?
win7, 32位,Python2.7, pywinauto
使用Pyinstaller打包.py文件为exe文件,exe文件运行报错:SendInput() inserted only 0 out of 2 keyboard events. 但是.py文件运行正常。
exe文件报错的代码在date.TypeKeys(timestr_1)这里报错,附上部分代码:
#调用加密程序encrypt.exe加密已导出的库文件
file_encrypt_0 = r'\加密(IPS&&IDS)\EncryptDB.exe'
file_encrypt_1 = PathStr + unicode(file_encrypt_0, 'utf8')
app_encrypt = Application().start(file_encrypt_1)
dlg_encrypt = app_encrypt.window_(class_name="#32770")
date = dlg_encrypt.window_(title_re='201', class_name="SysDateTimePick32")
date.TypeKeys(timestr_1)
按赞数排序
其他相似问题打包python文件为exe文件(PyInstaller工具使用方法) - DianaCody - 博客园
随笔 - 89, 文章 - 0, 评论 - 1, 引用 - 0
& & & & 最近做的新浪微博爬虫程序,打算打包成.exe软件以方便使用,网上找到一个很好的打包工具pyinstaller,这里记录一下打包的方法。
一、下载pyinstaller
我使用的版本为PyInstaller-2.1,支持python版本2.3-2.7,。
二、安装pyinstaller
下载完成后,解压即可。我的解压目录为D:\Python27\PyInstaller-2.1\
三、使用pyinstaller打包.py成.exe应用程序
1.注意使用前要安装pywin32,。
2.将需要打包的.py放到PyInstaller-2.1目录下,如下图所示。
在命令行,cd进入可执行python命令的目录,执行命令:python pyinstaller.py [opts] yourprogram.py
主要选项包括:
-F, –onefile 打包成一个exe文件。
-D, –onedir 创建一个目录,包含exe文件,但会依赖很多文件(默认选项)。
-c, –console, –nowindowed 使用控制台,无界面(默认)
-w, –windowed, –noconsole 使用窗口,无控制台
更详细的使用方法可以参考下载包里的doc目录下的Manual.html文件。
具体操作:
python pyinstaller.py-F sina_crawler.py
实际操作:(其实就是注意文件路径,我的pyinstaller安装目录D:\Python27\pyinstaller-2.1\)
cd到d:\Python27\目录下,然后命令:
python pyinstaller-2.1\pyinstaller.py -F pyinstaller-2.1\sina_crawler.py
如果最后出现Appending archive to EXE,则生成成功。
注意会生成(均在Python27目录下):
1. dist文件夹(包含生成好的sina_crawler.exe)
2.build文件夹(中间生成,没用,事后可以删掉)
3.sina_crawler.spec文件(中间生成,没用,事后可以删掉)
四、生成的微博爬虫软件
双击生成的dist文件夹里的sina-crawler.exe文件,运行软件开始爬取微博。
顺便说句题外话,对于控制台程序运行,无论是.py文件还是生成的.exe文件,程序运行完闪退的情况:可以在程序加上raw_input()函数,表示运行结束等待回车输入再退出。
爬下来的页面:温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
多么美的一出戏,我流着泪叹息、
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
本文转载自fc_lamp
二过程1 准备要打包的程序& &由于这里只是一个简单的演示,所以我拿&这篇文章中的代码来修改一下。& &代码中要注意编码问题,因为编码所在系统(输出)环境是GBK(中文),而百度的新版空间网页编码已更改为UTF-8编码,所以要注意转换一下。spider.py#coding:gbkimport urllib2,urllib,re,osimport cookielib,time'''
百度爬虫类
@author:FC_LAMP'''class SpiderBaiDu:
sqlit = None
baseurl = '/new/'
header = {'User-Agent':'Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/ Firefox/6.0.2'}
#处理单引号
def qutoSin(self,string):
return string.replace("'","")
#登陆百度空间
user 为用户名
为password
def LoginBaiDu(self,user,pwd):
cookie = cookielib.CookieJar()
cookieProc = urllib2.HTTPCookieProcessor(cookie)
opener = urllib2.build_opener(cookieProc)
urllib2.install_opener(opener)
'username':user,
'password':pwd,
'tpl':'mn',
'psp_tt':0,
'mem_pass':'on'
post = urllib.urlencode(post)
req = urllib2.Request(
url='/?login',
data=post,
headers = self.header
res = urllib2.urlopen(req).read(500)
if 'passCookie' in res:
flag = True
flag = 'Login Fail:%s'%user
return flag
def parse_html(self,domain,msg,debug=False):
url = self.baseurl+domain
#获取第一篇文章
c = urllib2.urlopen(url).read()
qbid = re.compile('.*?data-blogid="(.*?)".*?',re.S|re.I|re.U)
qbid = qbid.search(c)
if qbid==None:
raise Exception('此空间已被关!')
qbid = qbid.group(1)
url = '/%s/item/%s'%(domain,qbid)
postedit_url = '/pub/submit/modifytext';
i = 0 #禁言次数
while True:
c = urllib2.urlopen(url).read()
#获取标题:
title = re.compile(
'&title&(.*?)&\/title&',
re.S|re.I|re.U
title = title.search(c)
#解析成uncode对象
title = title.group(1).decode('utf-8')
print title
#获取下一篇连接
nexturl = re.compile(
'&div.*?class="detail-nav-pre"&.*?&a.*?href="(.*?)".*?hidefocus.*?&&\/a&.*?&\/div&',
re.S|re.I|re.U
nexturl = nexturl.search(c)
#获取token
modify_url = '/pub/show/modifytext?qbid='+qbid
modify_c = urllib2.urlopen(url).read()
qbtoken = re.compile(
'window.qBdsToken="(.*?)";'
qbtoken = qbtoken.search(modify_c).group(1)
#编码传回百度
postmsg = unicode(msg,'gbk').encode('utf-8')
postdata={
#'title':'愤怒离开:http://fc-lamp./',
'content':postmsg,
'qbid':qbid,
'bdstoken':qbtoken,
postdata = urllib.urlencode(postdata)
req = urllib2.Request(
url=postedit_url,
data = postdata,
headers = self.header
res = urllib2.urlopen(req).read()
res = eval(res)
if res['errorMsg']!='':
print '哎~~又被禁言了,休息四分种吧。'
time.sleep(240)
print '哎~~又被禁言了,休息两分种吧。'
time.sleep(120)
#是否还有下一篇
if nexturl==None:
url = self.qutoSin(nexturl.group(1).strip()).replace("\\",'')
qbid = url.split('/')[-1]
#例子if __name__ =='__main__':
while True:
print '---================----'
print '特别说明:此程序仅做程序学习所用,严禁任何形式的商业用途,否则后果自负!!!'
Author:FC_LAMP Blog: fc-lamp. 退出:quit'
print '---================----\n\n百度空间文章批量修改'
user = str(raw_input('\n你的用户名(回车确定):'))
pwd = str(raw_input('\n你的密码(回车确定):'))
print '登录中.....'
spider = SpiderBaiDu()
f = spider.LoginBaiDu(user,pwd)
if f == True:
print '登录成功!'
url = str(raw_input('你的空间域名(回车确定):'))
flag = str(raw_input('你确定要批量修改百度空间中的所有文章吗?(y/n)')).lower()
if flag =='y':
msg = str(raw_input('请输入新的内容:'))
st = time.time()
print '解析中.......'
spider.parse_html(url,msg,debug=True)
except Exception as e:
print '解析错误!空间无法被正常解析!空间是否被度娘关了(或没有文章)?'
et = time.time()
c = et - st
print('批量操作结束,耗时:%0.2f'%c)
print(f)2 下载相关包& &pyinstaller工具可以在 &&官网下载,但是如果是使用window方式来安装pyinstaller还需要一个扩展pywin32,可以& 在这里下载:&选择一个合适的版本。3 &打包& 首先安装好pywin32后,再按来安装pyinstaller。& 一切安装好后,我们来实际最简单的打包。& 1 进入pyinstaller的安装目录,将要打包的程序(spider.py)放在pyinstaller目录下。& 2 打开CMD,进入到pyinstaller的安装目录,输入命令:python pyinstaller.py&spider.py&& 到这一歩,相关的文件包已产生,更多的信息参看: &&效果图:&PS:此代码的程序猿还是初级水平~~十分欢迎批正!&
阅读(761)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'【转载】python 程序打包工具(pyinstaller,EXE)',
blogAbstract:'一说明& &将python程序打包成EXE格式的工具有很多,比如py2exe、pyinstaller等等。这里我使用pyinstaller工具来进行打包。二过程1 准备要打包的程序& &由于这里只是一个简单的演示,所以我拿
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}

我要回帖

更多关于 6s查找朋友位置不准确 的文章

 

随机推荐