how to detect list separator in users machine with Python?
CSV file needs to be created on users machine and the list separator must be detected automatically (so th
Provided the idea to read the list separator symbol from the Windows registry.
Provided the code to access Windows Registry values.
Using the _winreg package, the Windows list separator value can be retrieved from the registry as follows:
from _winreg import *
def getListSeparator():
'''Retrieves the Windows list separator character from the registry'''
aReg = ConnectRegistry(None, HKEY_CURRENT_USER)
aKey = OpenKey(aReg, r"Control Panel\International")
val = QueryValueEx(aKey, "sList")[0]
return val
print getListSeparator()