I am actually trying to remove or rename files name which contains question mark in python.
Does anyone would have some guidance or experience to share?
my files are like this:
??test.txt
?test21.txt
test??1.txt
the result that I am trying to get is:
test.txt
test21.txt
test1.txt
thank you for your help. AL
Below the code which I have attempted using the suggestion below:
#!/usr/bin/python
import sys, os, glob
for iFiles in glob.glob('*.txt'):
print (iFiles)
os.rename(iFiles, iFiles.replace("?",''))