It is better to use python for scripts because they are easier to maintain , extend and read as well as document. That doesn't mean that shell scripting is not something to learn. The knowledge of regular expressions is not a python invention , nor is the utility framework built-in to any Linux system. Don't let the names or symbols get in the way of understanding the relationships and effects. This particular snippet comes as a result of my compulsion to have sequences show up in order when listed in a directory.
It would be worth doing if it were possible to recharge Lewin to 30 years old again, like a battery. I would have fought to get a seat at those lectures. He is talented and if he could be rejuvenated it would be more of a gift to the world than to him personally.
def renameFormatted() : for filename in os.listdir('./') : if '.ogv' in filename: if re.search("lec.-",filename): filename2=filename.split('lec') filename3=filename2[0]+'lec0'+filename2[1] print filename,filename2,filename3
0 comments:
Post a Comment