随笔分类 -  脚本语言

Python中的编码
摘要:http://liguangming.com/how-to-use-utf-8-with-python http://www.lijiejie.com/python-sys-setdefaultencoding-trick/ http://blog.csdn.net/magicharvey/arti 阅读全文
posted @ 2016-02-16 11:47 阿笨猫 编辑
shell脚本中一些特殊符号
摘要:在shell中常用的特殊符号罗列如下:# ; ;; . , / \\ 'string'| ! $ ${} $? $$ $*\"string\"* ** ? : ^ $# $@ `command`{} [] [[]] () (())|| && {xx,yy,zz,...}~ ~+ ~- & \\<...\\> + - %= == !=# 井号 (comments)这几乎是个满场都有的符号,除了先前已经提过的\"第一行\"#!/bin/bash井号也常出现在一行的开头,或者位于完整指令之后,这类情况表示符号 阅读全文
posted @ 2011-10-20 13:23 阿笨猫 编辑
bash shell的调试
摘要:bash --debugger script script-arguments...习惯了vim,写bash shell也是用它,一般来说shell都比较精短,所以也没考虑什么提高效率的方法,今天无意中看见有人提到vim的一个编写bash的插件bash support,就下载了试试,果然强大。下载后按说明安装,gvim test.sh打开就看到bash菜单下强大的功能了,大部分虽然我们都用不到,至少我用不到,有的语法看都没看到过,不过可以当参考手册用。。。。接下来,我们需要调试功能,要安装bashdb,sudo apt-get install bashdb,然后装完后按照网上说法,bash s 阅读全文
posted @ 2011-10-20 10:19 阿笨猫 编辑
python正则表达式
摘要:http://www.sace.cn/members/persons/lpjcom/blog/20061011_115045_788http://blog.csdn.net/zhangj1012003_2007/archive/2010/04/16/5493714.aspxhttp://www.cnblogs.com/huxi/archive/2010/07/04/1771073.htmlhttp://wiki.ubuntu.org.cn/index.php?title=Python%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%93%8D%E 阅读全文
posted @ 2011-01-20 21:02 阿笨猫 编辑
python urllib编码
摘要:>>> import urllib>>> data = '丽江'>>> print data丽江>>> data'\xe4\xb8\xbd\xe6\xb1\x9f'>>>urllib.quote(data)'%E4%B8%BD%E6%B1%9F'那我们想转回去呢?>>> urllib.unq... 阅读全文
posted @ 2010-11-16 14:27 阿笨猫 编辑
__FUNCTION__ and __LINE__ in Python
摘要:When you want to log something, C pre-processor macros __FUNCTION__ and __LINE__ are quite helpful (althogh the first is a GNU extension for GCC, AFAIK). Python have the __name__ pseudo-variable with ... 阅读全文
posted @ 2010-10-22 11:45 阿笨猫 编辑
关于Python正则表达式的问题
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--#!/usr/bin/envpython#coding=utf-8importrestr=r'<docitemkey="founded_place"><![CDATA[中国广东深圳]... 阅读全文
posted @ 2010-09-10 17:40 阿笨猫 编辑
Python 调试命令
摘要:http://docs.python.org/library/pdb.htmlhttp://magustest.com/blog/computer/use-pdb-debug-python/用pdb调试有多种方式可选:1. 命令行启动目标程序,加上-m参数,这样调用myscript.py的话断点就是程序的执行第一行之前python -m pdb myscript.py2. 在Python交互环境中... 阅读全文
posted @ 2010-09-08 15:49 阿笨猫 编辑
perl 调试命令
摘要:http://developer.51cto.com/art/201007/213719.htmhttp://www.ibm.com/developerworks/cn/linux/sdk/perl/culture-4/index.htmlhttp://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perldebug.html#N... 阅读全文
posted @ 2010-09-07 22:02 阿笨猫 编辑
在Source Insight中看Python代码
摘要:http://blog.csdn.net/lvming404/archive/2009/03/18/4000394.aspxSI是个很强大的代码查看修改工具,以前用来看C,C++都是相当happy的。最近需要用Python,看了两天毫无颜色的UltraEdit之后决定,还是迁移回SI看。无奈SI默认不支持Python,需要进行下小小设置~~~步骤如下:下载个SI的CLF文件,地址为http://www.sourceinsight.com/public/languages/Python.CLF。打开SI。选项 | 参数选择 | 语言,点击“导入”,选择刚刚下载的Python.CLF文件,“确定” 阅读全文
posted @ 2010-09-02 10:04 阿笨猫 编辑
Python--- subprocess 创建子进程
摘要:http://blog.csdn.net/JGood/archive/2009/08/29/4498166.aspxsubprocess模块中只定义了一个类: Popen。可以使用Popen来创建进程,并与进程进行复杂的交互。它的构造函数如下:subprocess.Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, st... 阅读全文
posted @ 2010-08-13 17:50 阿笨猫 编辑