I want to implement a script that reads a CSS file and makes meaningful changes to it (adding/removing/replacing lines/words etc.). The basic logic is implement an RTL (right-to-left) transformation.
I could think of quite a few approaches to it:
- file reader - read a line, analyze it and make the needed changes to it.
- two phase scan - create in memory model, scan and change it, save model to text.
- regular expressions - It might be quite difficult because some of them might be very complex.
basically what I'm wondering is which of those, or other methods, would be the python way to do it? are there any relevant libraries you think I should be familiar with for this kind of operation?
Edit:
it's should be noted that this is a "learn python through this usable project" kind of project so I'm not familiar with most libraries you would mention here.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…