`
jnn
  • 浏览: 288210 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

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吧。
2
2
分享到:
评论
3 楼 freizl 2009-08-19  

Hope I didn't misunderstand the task is moving snapshot.xsd from one location to another. ;(
(ps: time stamp was not removed as I'm not sure the file conversion)


src_dir=${1}
des_dir=${2}

cd ${src_dir}
find -name *SNAPSHOT.xsd | awk -v dest=${des_dir} '{print "cp", $0, dest "/" $NF}' | sh

2 楼 jnn 2009-08-18  
freizl 写道
Seems using Shell scripts would be more easy for this task.

Just a technical discussion~


Can you give me a simple demo to show how to use Shell to do that ?
1 楼 freizl 2009-08-17  
Seems using Shell scripts would be more easy for this task.

Just a technical discussion~

相关推荐

    Black Hat Python · Python Programming for Hackers and Pentesters.rar

    When it comes to creating powerful and effective hacking tools, Python is the language of choice for most security analysts. But just how does the magic happen? In Black Hat Python, the latest from ...

    Python_The Bible_3 Manuscripts in 1 book-Maurice J. Thompson(2018)

    This book will help you to understand the basics of python in just 7 days. Code is the language of the future. And the time to learn the ins and outs of coding is now, unless of course you want to be ...

    Mastering Python for Networking and Security

    Master Python scripting to build a network and ... By the end of this book, you will be able to get the most out of the Python language to build secure and robust networks that are resilient to attacks.

    Python for Complete Beginners-Martin Jones(2017).pdf

    This book is an introduction to the Python programming language for complete beginners – those who have never written a program before, or who are just getting started with programming. Learning your...

    Python for DevOps Learn Ruthlessly Effective Automation.pdf

    The Python programming language was created in the early 1990s for use in system administration. It has been a great success in this area and gained wide adoption. It is a general-purpose programming...

    Learn Python the Hard Way

    Shaw teaches the Python programming language through a series of 52 brilliantly-crafted exercises-all formatted consistently, and most no longer than two pages (including 'extra credit'). Just read ...

    Packt.Python.Interviews.2018.2

    But, must importantly — it exposes that Python, the programing language, is indeed comprised of persons, just like you, trying to make a difference in the world, one step at a time.

    Natural Language Processing in Python 【2016】

    LazyProgrammer, "Natural Language Processing in Python: Master Data Science and Machine Learning for spam detection, sentiment analysis, latent semantic analysis, and article spinning" 2016 | ASIN: ...

    Python.Crash.Course.15196386.epub

    Perhaps you are an amateur just getting started with Python, or maybe you already know a few things about this exciting programming language and you'd like to reach for the next level. Which one are ...

    Java.to.Python 高清完整epub版

    For the engineer who is already proficient in Java, it would be a waste of time to study a Python textbook that begins with the basic concept of object-oriented programming, since the concept of OOP ...

    Think Python(2nd Edition)

    Think Python is ideal for students at the high school or college level, as well as self-learners, home-schooled students, and professionals who need to learn programming basics. Beginners just ...

    Effective Python Development for Biologists pdf

    Python is rapidly becoming the standard language for many talks in scientific research, and is particularly popular in biology and bioinformatics. One of the great strengths of Python is the ecosystem...

    Head First Python (2nd)

    Head First Python文档,这是官方的PDF,清晰度高。the basics Getting Started Quickly ... Along the way, you’ll learn about a few of the things that make Python the programming language it is.

Global site tag (gtag.js) - Google Analytics