If you work with strings in your Python scripts and you're writing obscure logic to process them, then you need to look into regex in Python. It lets you describe patterns instead of writing ...
If your SageMath Python version is older than 3.9.0, some features in some scripts might not work. Then you can simply execute the file using Sage. It does not matter where you execute it from, the ...