def quote_sheetname(sheetname):
 if ((not sheetname.isalnum()) and (not sheetname.startswith("'"))):
  sheetname = sheetname.replace("'", "''")
  sheetname = ("'%s'" % sheetname)
 return sheetname

def quote_sheetname ( sheetname ) : if ( ( not sheetname . isalnum ( ) ) and ( not sheetname . startswith ( "'" ) ) ) : sheetname = sheetname . replace ( "'" , "''" ) sheetname = ( "'%s'" % sheetname ) return sheetname
convert a worksheet name to a quoted name if it contains spaces or special characters .