This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import time | |
from pypinyin import pinyin, lazy_pinyin | |
import pypinyin | |
py = lazy_pinyin(unicode("_".join(sys.argv[1:]), "utf-8")) | |
fileName = ''.join(py) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from pyPdf import PdfFileWriter, PdfFileReader | |
import glob | |
for filename in glob.glob(r'./in/*'): | |
print filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""" Encoding, to make sure the Chinese words looks nice | |
set encoding=utf-8 | |
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 | |
set termencoding=utf-8 | |
scriptencoding utf-8 | |
""""""""""" Common Setting | |
set wrap | |
set guifont=Menlo\ Regular:h24 | |
set display=lastline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Modeline and Notes { | |
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell: | |
" | |
" __ _ _____ _ | |
" ___ _ __ / _/ |___ / __ __(_)_ __ ___ | |
" / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \ | |
" \__ \ |_) | _| |___) |_____|\ V / | | | | | | | | |
" |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_| | |
" |_| | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
最通用的做法是,在程序的前面加上 | |
# -*- coding: utf-8 -*- | |
import sys | |
reload(sys) # reload 才能调用 setdefaultencoding 方法 | |
sys.setdefaultencoding('utf-8') # 设置 'utf-8' | |
第一行注释是程序本身的编码,就是说在代码中如果有汉字的字条串,一样可以识别。下面的几行,是使程序内部使用utf-8编码。这样,读写文件,和在mac的终端中重定向输出都没问题。 | |
如果没有后三行,在处理utf-8字条串时,要用 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""" Encoding, to make sure the Chinese words looks nice | |
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
""""""""""" Common Setting | |
set wrap | |
set guifont=Menlo\ Regular:h28 | |
set display=lastline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
reload(sys) | |
sys.setdefaultencoding("utf-8") | |
readFile = open('test.txt', 'r') | |
print readFile.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imap <C-H> <Left> | |
imap <C-J> <Down> | |
imap <C-K> <Up> | |
imap <C-L> <Right> | |
UnBundle 'scrooloose/syntastic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""""""""""""""""""""插件管理,使用Bundle | |
"Vundle | |
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! |
NewerOlder