本来是想找个函数,但是网上大部分都是for和while太麻烦,如下即可。
从0加到5
sum([n for n in range(6)])
11月
30
本来是想找个函数,但是网上大部分都是for和while太麻烦,如下即可。
从0加到5
sum([n for n in range(6)])
“git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
“vim +PluginInstall +qall
"git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim "vim +PluginInstall +qall set nocompatible " be iMproved, required filetype off " required set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'tpope/vim-fugitive' Plugin 'git://git.wincent.com/command-t.git' Plugin 'file:///home/gmarik/path/to/plugin' Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} Plugin 'ascenator/L9', {'name': 'newL9'} call vundle#end() " required filetype plugin indent on " required Plugin 'flazz/vim-colorschemes' Plugin 'vim-scripts/pep8' Plugin 'Valloric/YouCompleteMe' Plugin 'Lokaltog/vim-powerline'
#!/bin/env python3 #-*- coding:utf-8 -*- import tornado.ioloop import tornado.locale import tornado.web import hashlib class checkHandler(tornado.web.RequestHandler): def get(self): signature = self.get_argument('signature') timestamp = self.get_argument('timestamp') nonce = self.get_argument('nonce') echostr = self.get_argument('echostr') token = 'xxxxxxx' list1 = [token, timestamp, nonce] list1.sort() strList = ''.join(list1) sha1 = hashlib.sha1() sha1.update(strList.encode('utf-8')) if sha1.hexdigest() == signature: self.write(echostr) else: self.write('')
http://nuitka.net
http://www.pyinstaller.org
推荐使用pyinstaller
安装加密模块
pip install PyCrypto
安装加壳工具
yum install upx
找到upx位置
#whereis upx
#upx: /usr/bin/upx /usr/share/man/man1/upx.1.gz
# pyinstaller -F –key !@#$%^&*gew –upx-dir /usr/bin/upx –clean test.py
编译测试,keys为pyc加密使用。
>>> import datetime
>>> datetime.datetime.now().isocalendar()
(2018, 14, 7)
#返回结果是(年号,第几周,第几天)
>>> (int(datetime.datetime.now().strftime(“%m”))-1)//3+1
2
#返回结果是当日的季度
>>> (int(datetime.date(2014,8,15).strftime(“%m”))-1)//3+1
3
#返回制定日期的季度