共 30 篇文章
显示摘要每页显示  条
根据OAuth2验证协议,首先要引导用户访问授权页,然后通过回调地址里的code得到access token,然后每次读写用户信息时要将access token和自己的app key,app secret一起POST过去。def deal_token_expires(self):r=self.client.request_access_token(self.code,CALLBACK_URL)self.access_token=r.access_token.self.client.set_access_token(sel...
一键开机启动添加(python)一键开机启动添加(python)## file2autorun.pyimport sysimport win32apiimport win32conimport osdef addfile2autorun(path): runpath = "Software\Microsoft\Windows\CurrentVersion\Run" hKey = win32api.KEY_SET_VALUE) path = os.path.abspath(path) if False == os.path.isfile(pa...
使用Python操作注册表。与注册表操作相关的函数可以分为打开注册表、关闭注册表、读取项值、c添加项值、添加项,以及删除项等几类。对注册表进行操作前,必须打开注册表。>>> import win32api # 导入win32api模块>>> import win32con # 导入win32con模块# 使用RegOpenKey打开注册表项>>> key = win32api.Reg...
py2exe.# In fact, the effect equals call "python setup_example.py py2exe".sys.append(''py2exe'')setup(console=["yourcode.py"])============================================================代码2:setup.py (雍容华贵模式----打包成单一的windows console) 执行方式:python setup....
system tray#encoding=gbkimport string, reimport wximport loginSingleclass SingleLoginContextMenu(wx.Menu): def __init__(self, parent): super(SingleLoginContextMenu, self).__init__() self.parent = parent item = wx.TaskBarIcon.__init__(self) self.frame = frame self.icon = self.PopupM...
# encoding: UTF-8import re # 将正则表达式编译成Pattern对象pattern = re.compile(r''hello'') # 使用Pattern匹配文本,获得匹配结果,无法匹配时将返回Nonematch = pattern.match(''hello world!'') if match: # 使用Match获得分组信息 print match.group() ### 输出 #### hello.subn(repl, string[,...
配置vi适合于Python编程 配置vi适合于Python编程。" Turn on syntax highlighting and autoindentingsyntax onfiletype indent on" set autoindent width to 4 spaces (see" http://www.vim.org/tips/tip.php?tip_id=83)set et.set sw=4set smarttab" Bind <f5> key to running the python interpreter on the cur...
帮助 | 留言交流 | 联系我们 | 服务条款 | 下载网文摘手 | 下载手机客户端
北京六智信息技术股份有限公司 Copyright© 2005-2024 360doc.com , All Rights Reserved
京ICP证090625号 京ICP备05038915号 京网文[2016]6433-853号 京公网安备11010502030377号
返回
顶部