samedi 27 décembre 2014

\06 is converted to a character that looks like a spade



saveInPath = "C:\Users\User\Documents\AV_FILES\06_School\Python205\ProjectNov2014\CODE_CLEAN\NotQuiteBackUP"

lccSysProcCons = SystemProcessControls()

dateTimeNow = lccSysProcCons.getDateTimeNow()

name = "Rejected Tracks List %s" % str(dateTimeNow)

saveAsName = saveInPath + "\" + name + ".txt"

print saveAsName



The code above is from a python script currently being developed. The script errors out due to an invalid filename. The saveAsName variable appears to invalidate the script. When printed out it shows up as:



C:\Users\User\Documents\AV_FILES♠_School\Python205\ProjectNov2014\CODE_CLEAN\NotQuiteBackUP\Rejected Tracks List 2014-12-27 15:31:07.txt



NOTICE the spade character [♠] in place of [\06]. Why is this? This will probably be resolved by changing the folder name. I just want to know why this happens.





Aucun commentaire:

Enregistrer un commentaire