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 {"[email protected]", "[email protected]"}
set cclist to {"[email protected]", "[email protected]"}
set x to "/Users/e888467/Desktop/works/004_Research/DevOps/builds/DeviceConfigurator/JiaDingEmail/xaa" as POSIX file
set j to "/Users/e888467/Desktop/works/004_Research/DevOps/builds/DeviceConfigurator/JiaDingEmail/xab" as POSIX file
set attachments to {x, j}

tell application "Microsoft Outlook"
    set the_Content to ("Hi Team,

please unzip the attachments to get ipa and install.
Any question let me know.
") 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

你可能感兴趣的:(Python Web 笔记)