Re: [programming] shell script pake python

2000-06-12 Terurut Topik Andri Grananda
On 12-Jun-2000, Steven Haryanto wrote: > intinya adalah regular expression. anda bisa belajar > lebih banyak barang yang satu ini dari manual perl :-) Wah makasih Bung, tak coba dulu, kalo perl, blom bisa :^) Andri -- *** *** * ** Confucious say: "Is stuffy inside fortune

Re: [programming] shell script pake python

2000-06-12 Terurut Topik Steven Haryanto
pake modul re: """ #!/usr/bin/python import os,sys import re def scanner(name, function): file = open(name,'r') for line in file.readlines(): function(line) file.close() def processLine(line): mo = re.match(r'^!(\S+)(?: (\S+))?', line) if mo: command, argument = mo.group(1, 2)