I want to implement a script that reads a CSS file and makes significant changes to it (add / remove / replace lines / words, etc.). The basic logic implements the RTL transform (from right to left).
I could come up with several approaches to it:
- file reader - read the line, analyze it and make the necessary changes.
- two-phase scanning - create a model in memory, scan and change it, save the model in text.
- regular expressions. This can be quite difficult, because some of them can be very complex.
Basically, what interests me is which of these or other methods would be the python way to do this? Are there any relevant libraries that you think I should know for this kind of operation?
Edit: It should be noted that this is a “learn python through this useful project” project, so I am not familiar with most of the libraries that you mentioned here.
arikg source share