You don't really 'convert' to a PHYLIP. It's an alignment format so it's output from alignment tools.
That said, since your sequences are already all the same length, we can pretend your sequences are aligned, so you could try:
1. Convert to a 'normal' format.
# Change to fasta format:
$ sed -e 's/^/>/g' -e 's/ /\n/g' myfile.txt > myfile.fasta
2. Convert formats with BioPython.
from Bio import AlignIO
alignments = AlignIO.parse('myfile.fasta', "fasta")
AlignIO.write(alignments, 'myfile.phy', 'phylip')
Note: this only works because your sequences are already the same length regardless of alignment.
Evidently the sequences are all very alike, so it might be fine, but if you're planning to do something phylogenetic with them, you should align, not just coerce the formats.
Edit:
Here's some full, full-python code, to go from that input file to a Phylip using the approach I described:
import sys
from Bio import AlignIO
import io
with open(sys.argv[1], 'r') as ifh:
fasta = ''.join('>%s\n%s\n' % (i[0], i[1]) for i in [str.split() for str in ifh] )
iter = AlignIO.parse(io.StringIO(unicode(fasta)), 'fasta')
AlignIO.write(iter, sys.argv[2], "phylip")
Invoke the code as:
$ python txt2phylip.py inputfile.txt outputfile.phylip