Python Web 笔记

  1. 部署apache
    安装扩展模块mod_wsgi:
    http://blog.csdn.net/laughing2333/article/details/51326996
    2.开发调试阶段直接解释器 运行python文件即可
    http://www.pythondoc.com/flask/quickstart.html

3.OSError: [Errno 1] Operation not permitted:
pip install ipython --user -U

4.支持https:
生成证书:

  1. 怎么保存退出vi编辑
    w:保存 q:退出 !:强制 e:放弃修改
    按ESC键 跳到命令模式,然后:
    :w 保存文件但不退出vi
    :w file 将修改另外保存到file中,不退出vi
    :w! 强制保存,不推出vi
    :wq 保存文件并退出vi
    :wq! 强制保存文件,并退出vi
    q: 不保存文件,退出vi
    :q! 不保存文件,强制退出vi
    :e! 放弃所有修改,从上次保存文件开始再编辑

6.Debug Python[https://www.ibm.com/developerworks/cn/linux/l-cn-pythondebugger/]
7.JS socketio
namespace 一定要写,要不然收不到消息
8 notificatin:
http://blog.csdn.net/june_fiend/article/details/41675207
https://bitbucket.org/dtbog/apns-client/commits/875f12af6dd23e8c2c58be0849706b682d57ec41?at=default
遇到问题:
复制粘贴害死人,要看源码,知道每个参数的意思,如下:
第一个参数是token,可以一个可以数组,但是从网上复制的时候,不知道,

Message(['my','device','token'], alert="My message 2", badge=1)

复制后直接调试,结果

tok = binascii.unhexlify(token) 
TypeError: Non-hexadecimal digit found

其实就是因为'my','device' 也要是token 才行,改为如下即可:

Message(['58fa4d21fcc28a7df332c939b638b39b9780b09e5ae609e7cc79cfca17692697'], alert="My message 2", badge=1)
  1. 分包压缩&解压【文件总大小不变,只是问了降低单个文件大下】
#!/bin/bash

name=$1
zip $name.zip $name &&
split -b 10485760 $name.zip

解压:
cat x* > file.zip

10 applescript, auto create email ,you just click send

set maillist to {"Yuan.Li2@xxx.com", "Yunliang.Zhou@xxx.com"}
set cclist to {"Yang.Zhang2@xxx.com", "Mark.Hua2@xxx.com"}
set x to "/Users/xxx/Desktop/works/004_Research/DevOps/builds/xx/xx/xaa" as POSIX file
set j to "/Users/xxx/Desktop/works/004_Research/DevOps/builds/xx/xx/xab" as POSIX file
set attachments to {x, j}

tell application "Microsoft Outlook"
    set the_Content to ("Hi Team,<br><br>
 please unzip the attachments to get ipa and install.<br>
 Any question let me know.<br>")
    set newMessage to make new outgoing message with properties {subject:"New Build", content:the_Content}
    repeat with theItem in maillist
        make new recipient at newMessage with properties {email address:{name:"", address:theItem}}
    end repeat
    repeat with ccItem in cclist
        make new cc recipient at newMessage with properties {email address:{name:"", address:ccItem}}
    end repeat
    
    tell newMessage
        make new attachment with properties {file:x}
    end tell
    tell newMessage
        make new attachment with properties {file:j}
    end tell
    open newMessage
    activate
    --注释,如果想直接发送就把open newMessage 改成 send newMessage
end tell
  1. selenium
    1.mac下 driver可以安装在 usr/local/bin 下面,大多数教程都是说usr/bin, 但是新版的OS 有了一个系统限制《多了解系统设计,遇到问题就可以自己解决》
    2.find_element_by_class_name :http://www.mamicode.com/info-detail-1821583.html
  2. authentication alert by selenium,使用firefox,不要用chrome
    https://stackoverflow.com/questions/40671662/how-to-handle-windows-authentication-popup-in-selenium-using-pythonplus-java
    https://stackoverflow.com/questions/45328654/python-selenium-alert-prompt-username-password-is-not-working
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 洞见SELENIUM自动化测试 写在最前面:目前自动化测试并不属于新鲜的事物,或者说自动化测试的各种方法论已经层出...
    厲铆兄阅读 11,702评论 3 47
  • # Python 资源大全中文版 我想很多程序员应该记得 GitHub 上有一个 Awesome - XXX 系列...
    aimaile阅读 26,736评论 6 427
  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 9,971评论 0 5
  • 昨天,陪孩子写作业,快把我气吐血了,当然,他也没啥好果子吃! 自认为被家里两个熊孩子磨的已经没脾气了。可是~~可~...
    红豆乐阅读 2,915评论 0 1
  • 《似水年华》是我非常喜欢的电视剧,像是一坛酒,越放越香。它在记忆深处,隔几年再看,仍然有不同的感动,就像偶然嗅到放...
    林蓝阅读 3,372评论 0 0

友情链接更多精彩内容