Hi, I currently am running a simple script that substitutes the comma in a text file with a period. This is basically to change a bunch of european files to american dot.
I'd like to prompt the user and allow the user to browse for a location of the folder when the program is run.
This is my current code.
How does one do this in Python?
I'd like to prompt the user and allow the user to browse for a location of the folder when the program is run.
This is my current code.
Code:
path="C:\Python27\RED"
#I need to make path browseable
import os
myFiles=os.listdir(path)
def replaceText(myFile):
for line in open(myFile):
line = line.replace(",", ".")
o.write(line)
for x in myFiles[:]:
myFile = x
writeFile = "period" + x
o = open(writeFile,"a")
replaceText(myFile)
o.close()
Comment