I'm starting with python and I'm trying to make a script that takes a txt
file with a list of words vertically and copied the same word next to it this automatically, it would be something like that.
dictionary.txt:
casa123
perro454
gato783
raton12
and I want to get this:
casa123casa123
perro454perro454
gato783gato783
raton123raton123
What I have of the script is this, and I can not get it to show me what I want. I know it's simple but it's always hard to start. I hope you can help me and thank you.
#!/usr/bin/env python
dic = open("/media/particion/dic.txt", "r+") for linea in dic:
dic2 = open("/media/particion/dic2.txt", "a")
s1 = linea + linea
dic2.write(s1)