Ifttt Note

IFTTT Maker A simple test: import os def test(): """ Test ifttt maker the command template is: curl -X POST -H "Content-Type:application/json" -d '{"value1":"第一个参数","value2":"第二个","value2":"第三个"}' 'https://maker.ifttt.com/trigger/test/with/key/your_key' :param: :return: """ key = 'csO7ZoutwPzCc_Your_key' arg1 = '第一' arg2 = '第二' arg3 = '一二三四五六七八九十' template = [ 'curl -X POST -H "Content-Type:application/json" -d ', "'{", '"value1":"{}","value2":"{}","value3":"{}"'.format(arg1,arg2,arg3), "}' ", 'https://maker.ifttt.com/trigger/test/with/key/', key ] os.system(''.join(template)) if __name__ == '__main__': test()

May 21, 2017 · 1 min · Me

PyQt5 Note

安装 PyQt5 及其文档 unbuntu plantform sudo apt-get install python3-pyqt5 pyqt5-doc pyqt5-examples sudo apt-get install python3-pyqt5* qtbase5-doc qttools5-dev-tools 示例所在目录:/usr/share/doc/pyqt5-examples/examples/qtdemo/qtdemo.py 文档所在目录: /usr/share/qt5/doc 安装更多: OSX plantform brew install python3 brew install pyqt5 文档和示例都在源代码中, download PyQt5 assistant /usr/local/Cellar/qt/5.9.0/libexec/Assistant.app /usr/local/Cellar/qt5/5.6.1-1/libexec/Assistant-qt5.app/Contents/MacOS/Assistant PyCharm 配置相关工具 Linux Mint qt5desinger: Program: /usr/lib/x86_64-linux-gnu/qt5/bin/designer Parameters: $FileName$ Working directory: $FileDir$ pyuic: Program: python3 Parameters: -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutAllExtensions$_ui.py Working directory: $FileDir$ qt5assistant: Program: /usr/lib/x86_64-linux-gnu/qt5/bin/assistant 关于 model index 获得 model index: index = model....

May 15, 2017 · 1 min · Me

Semantic Note

Install Install NodeJs: brew install node Install Gulp: npm install -g gulp Install Semantic UI: npm install semantic-ui --save cd semantic/ gulp build Include in Your HTML: <link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css"> <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> <script src="semantic/dist/semantic.min.js"></script> Updating: npm update

May 11, 2017 · 1 min · Me

Python Note 100 - File

Python 文件操作

February 13, 2017 · 2 min · Me

Python Note 200 - List

列表推导(过滤) 以过滤偶数为例,一般方法: numbers = [1,2,3,4,5,6] even = [] for number in numbers: if number%2 == 0: even.append(number) 推导方式过滤: numbers = [1,2,3,4,5,6] even = [number for number in numbers if number%2 == 0] 倒序列表 >>> lst = [1, 2, 3, 4, 5] >>> lst.reverse() >>> lst [5, 4, 3, 2, 1] >>> a = [1,2,3] >>> a[::-1] [3, 2, 1] >>> lst = [1, 2, 3, 4, 5] >>> list(reversed(lst)) [5, 4, 3, 2, 1] 判断一个列表是否为空 if mylist: # Do something with my list else: # The list is empty 排序 列表排序有两种方式,一种是列表自带的方式 sort,一种是内建函数 sorted 。 复杂的数据类型可通过指定 key 参数进行排序。 由字典构成的列表,根据字典元素中的 age 字段进行排序:...

February 13, 2017 · 3 min · Me