Determining if a filename is greater than X characters

hokiegal99 hokiegal99 at hotmail.com
Sun Aug 3 04:15:52 CEST 2003


How would I determine if a filename is greater than a certain number
of characters and then truncate it to that number? For example a file
named XXXXXXXXX.txt would become XXXXXX

	fname = files
	if fname[0] > 6
	   print fname[0]

Thanks!!!




More information about the Python-list mailing list