2008-03-17
Python is just the language for you
这是我最近写的一个将Camel发布在maven2的shapshot schema 拷贝到指定目录下的python小脚本。
发现自己开始迷恋上了python,体验着一种新的写程序的方式。
以前不管是用bash 还是写windows bat,就是简单的设置一下环境变量然后调用一下写好的程序,很少做一些逻辑的判断(小声说,复杂的我也不会)。而用python在写脚本的同时不刻意拘泥与C++或者Java的强类型处理,简单几行代码就完成了处理文件的操作,突然感觉写程序会如此的轻松。
下面是从python tutorise 上面拷贝下来的,你在什么的情况下使用python.
If you do much work on computers, eventually you find that there's some task you'd like to automate. For example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bunch of photo files in a complicated way. Perhaps you'd like to write a small custom database, or a specialized GUI application, or a simple game.
If you're a professional software developer, you may have to work with several C/C++/Java libraries but find the usual write/compile/test/re-compile cycle is too slow. Perhaps you're writing a test suite for such a library and find writing the testing code a tedious task. Or maybe you've written a program that could use an extension language, and you don't want to design and implement a whole new language for your application.
作为对传统语言的扩展,你可以把 python看成是一个超级胶水,通过这个超级胶水可以让在已有的库函数上快速构建自己需要的应用,如果当前的库不好用,或者没有适合你的使用的库,你可以用C或者Java写一个简单的扩展然后交给python来调用。
如果你想让你做的系统操作更简单,或者把你从沉重而重复的命令行指令中解脱出来,和我一样学习python吧。
发现自己开始迷恋上了python,体验着一种新的写程序的方式。
以前不管是用bash 还是写windows bat,就是简单的设置一下环境变量然后调用一下写好的程序,很少做一些逻辑的判断(小声说,复杂的我也不会)。而用python在写脚本的同时不刻意拘泥与C++或者Java的强类型处理,简单几行代码就完成了处理文件的操作,突然感觉写程序会如此的轻松。
下面是从python tutorise 上面拷贝下来的,你在什么的情况下使用python.
If you do much work on computers, eventually you find that there's some task you'd like to automate. For example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bunch of photo files in a complicated way. Perhaps you'd like to write a small custom database, or a specialized GUI application, or a simple game.
If you're a professional software developer, you may have to work with several C/C++/Java libraries but find the usual write/compile/test/re-compile cycle is too slow. Perhaps you're writing a test suite for such a library and find writing the testing code a tedious task. Or maybe you've written a program that could use an extension language, and you don't want to design and implement a whole new language for your application.
作为对传统语言的扩展,你可以把 python看成是一个超级胶水,通过这个超级胶水可以让在已有的库函数上快速构建自己需要的应用,如果当前的库不好用,或者没有适合你的使用的库,你可以用C或者Java写一个简单的扩展然后交给python来调用。
如果你想让你做的系统操作更简单,或者把你从沉重而重复的命令行指令中解脱出来,和我一样学习python吧。
发表评论
- 浏览: 44577 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
CXF jaxws spring configu ...
这个你可以看看CXF中的代码,spring.schemaspring.handl ...
-- by jnn -
CXF jaxws spring configu ...
你好,能不能具体说下怎么配置 在META-INF中添加spring.schema ...
-- by hanjun132 -
How to work on the offli ...
本人觉得git的branch和merg功能比svn强大很多,在权限管理上面是有些 ...
-- by jnn -
How to work on the offli ...
好像git没有权限控制功能?这在team似乎是个问题。
-- by 老熊 -
我眼中的CXF之Configurat ...
这部分的内容是和CXF配置实现相关的内容,需要你研究过CXF的实现代码(当时修改 ...
-- by jnn






评论排行榜