Determining if a filename is greater than X characters

hokiegal99 hokiegal99 at hotmail.com
Sat Aug 2 22:15:52 EDT 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