Re: Decimal separator from python to C
niki <[email protected]> Tue, 27 Mar 2012 11:01:23 +0300
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
On 26.03.2012 23:32, M. wrote: > Hi all, > > I'm using ctypes as a wrapper from a Pyside program to a C program. > Everything goes smoothly till I have to pass values to the C function. > The C function receive the values correctly when using > ctypes.c_double(), but the separator _inside_ the C code changed from > . to , and that is REALLY weird. Printing the data from python it > shows that is a float, and inside the C code everything is declared > accordingly. printf inside the C code shows a comma , as the > separator, while a C code compiled using the same compiler on the same > system shows period . as the separator. Any clues? My locale is > pt_BR-UTF-8. Python sets locale as requested by user/os e.g. "pt_BR-UTF-8". Try to set it back to "C". HTH Niki ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure