An easy way to achieve this is using either Jalview [https://www.jalview.org/] for multiple sequence alignments (MSA or single sequence) or using regular expression (for a single sequence).
Simply follow the following in Jalview:
1. Open your sequence alignment.
2. Identify the sequence from which you wish to remove the alignment gaps.
3. Right click on the sequence and select "Remove insertions"
4. Save your MSA.
If it is a single sequence you can simply do it via a regular expression such as: "s/-//g". You can implement something similar to that in python. Alternatively, you can perform this within usegalaxy.org|usegalaxy.eu under the "text transformation with sed" tool.