arcgis python脚本
Script Name: Spider_Create
#Script Label: Create Spider Diagrams
#
#Description: Custom python script developed to create spider diagrams from points contained
#in one or two feature classes. If using two feature classes, one feature class must contain
#the origins and the other must contain the destinations.
#
#Source Script File: Spider_Create.py
#Programming Language: Python 2.4
#ArcGIS Version: ArcGIS 9.2
#Author: Anthony Palmer, U.S. Army Corps of Engineers, Tennessee-Tombigbee Waterway
#Email: anthony.g.palmer@sam.usace.army.mil
#Date: 04/04/2007
#
#Parameters:
#
# Display Name Data Type Type Direction MultiValue Dependency
# argv[1] Origin Point Feature Class Feature Class Required Input No
# argv[2] Select Subset of Origins SQL Expression Optional Input No Origin Point Feature Class
# argv[3] Select Origin Key Field Field Required&n
相关文档:
一颗语法糖——装饰器
理论不去管,只管能办事:
1. 我要让一个函数在执行的时候,去做一些事情,比如,我要看看这些函数是不是有docstring,将这个功能拿出来,定义一个装饰器:
def showmedoc(func):
if func.__doc__:
& ......
vim支持大部分文件格式的语法高亮,而且可以自定义。不过缺省的python语法高亮感觉太少,修改一下。
1.修改语法高亮文件
vim/vim72/syntax/python.vim
将" let python_highlight_all = 1
前面的引号去掉,可支持内置函数,数字,空格,异常的语法高亮。
2. 将self加进
syn keyword pythonBuiltin&n ......
下载了很多压缩文件,就写了一个脚本
在Python中使用winrar命令,所以一般压缩文件都支持
有些压缩文件Python中还没有相应的库
你得先把winrar添加到path环境变量中
把代码保存为rar.py
在dos下使用,如:rar.py "D:\A B\C" mkdir
#rar.py
#decompress with winrar
#arguments :filename directory opt
# op ......
* java强制使用OO进行应用开发,Python可以用函数式编程。函数式有时显得非常简单,代码量巨减。回想起Java动不动的N层、还有一个个对象,真的有那种心要吗?而且Python本身语言风格就简洁,再加上简洁的函数,在开发效率、Debug、测试上似乎会有优势。
* 大型复杂项目的性能更多地体现在架构、硬件拓扑结构上等。应对 ......
Python 社区有句俗语:“Python 自己带着电池。” 别自己写计时框架。Python 2.3以后 、具备一个叫做 timeit 的完美计时工具。DiveInto中的例子
>>> import timeit
>>> t = timeit.Timer("soundex.soundex('Pilgrim')",
... "import soundex")
>>> t.timeit() ......