Help yourself in python

October 31st, 2007 mysurface

If your computer science student, you study IT, click with technology, python is not a snake for you. It is a scripting-like programming language that are so famous today. You can type python into google, the first link is not about the reptile but the programming language. There are plenty of apps and scripts written [...]

Posted in Developer, python | Hits: 21589 | 3 Comments »

Reverse a string

October 9th, 2006 toydi

python provides a -c option to accept and run a script line. To reverse a string like this one: “toydi deified idiot”. echo ‘toydi deified idiot’ | python -c “print raw_input()[::-1]” echo prints the string to stdout. python run the script line. raw_input() read from stdin (to read from pipe and return the string). [::-1] [...]

Posted in python, rev | Hits: 52875 | 10 Comments »

writting executable script

October 8th, 2006 mysurface

Shell script (sh), Bash script (bash), Python and perl are all scripting language. By default, to run a scripting file, for example Python script, you need to do this: python myscript.py Another example for shell script: sh myscript.sh But we make is executable and can execute by running directly like this ./myscript.py If you place [...]

Posted in Bash, chmod, Developer, file, python, sh, which | Hits: 74463 | 8 Comments »