How do I change the name of a file path correctly in Python?
问题 My code specFileName = input("Enter the file path of the program you would like to capslock: ") inFile = open(specFileName, 'r') ified = inFile.read().upper() outFile = open(specFileName + "UPPER", 'w') outFile.write(ified) outFile.close() print(inFile.read()) This is basically make to take in any file, capitalize everything, and put it into a new file called UPPER"filename". How do I add the "UPPER" bit into the variable without it being at the very end or very beginning? As it won't work