Change of encoding while writing to file - Raspberry Pi Forums


dear all!

reading data sense hat accelerometer , writing file.
can explain why, @ point encoding of written file changes?

first 10 lines of output file ok:
2017-08-09 15:41:35.299113,0.0592413879931,0.00484891841188,1.13197183609
2017-08-09 15:41:35.322011,0.058755800128,-0.0619557499886,0.975518465042
2017-08-09 15:41:35.344613,0.0611837282777,-0.0130822891369,0.977468073368
2017-08-09 15:41:35.367283,0.0592413879931,-0.0113544398919,0.972837805748
2017-08-09 15:41:35.389731,0.0609409362078,-0.0118481107056,0.972350418568
2017-08-09 15:41:35.412242,0.0604553483427,-0.0128354532644,0.973325252533
2017-08-09 15:41:35.435372,0.0606981404126,-0.0140696316957,0.971375644207
2017-08-09 15:41:35.458535,0.0609409362078,-0.0123417824507,0.970400869846
2017-08-09 15:41:35.481643,0.0606981404126,-0.0120949465781,0.970157146454
2017-08-09 15:41:35.504780,0.0597269758582,-0.0140696316957,0.971619307995

after few hours this:

/�*}��������l�����!��
��4u��ҁ���ńq�ý�����Ӏy}Ł{������yx�*��������n�!n�,zо��-�6#����;�����b����꼄~҃����f���Їڿoyn*�����5�{u�3����

�v��g����o�n�c���a�#�a�����ˁ�h���o�����^�ǃ�*�����wτ
���ڿj�*����� ���&���p��5$�q�o�o����������4�ٿp�l*�����ؽp�����Ի��p�k{a���� �u�� *�������Ç���"���b�΂n���*����������y�f�g�<��1~��ɂؾ��]����y����=�ۀ�z������h���������e�Ո.�7~���}m��$���������{�6���������z��{�q*����
�u��u������ku���k�t��h}{��}��� }�tv��ya�k
j��̾��u��|*�����~1����i��xzw��g�9�n�:��`|���"�[����7�#�<�� \��w��[�@*����tzӼ:�ւ��b�g�c�ڄ���sv�y������q�e�����pzf�Ռ��,{8�����;*������x�����t���b
�vzĀ��i������o�ޅ||��΋l�kw�r�@���h��+*����f[���y��}m�u��������i���������������:���c�t�ā���*�����ӿ|܀�⅌y����=�����rɁu���&�[����vk�������l��]����h|���}Ҁ��6��-��g���)��'�������{ȸc�Ń*yr*���� ځ��ހ7 �sp������׾
�f��'��:�
�j}��m������;���0*����a�a��0��+���������̅|�/���j���� ��g�򀩂꿕���d���`*�������ψ�w}n�]�/��j�$���̀+��sn��

�$��|;�c�d��2�g�q���*������i�ڽ����܀��1�À;d���ڃ���su���
w�{�ҁ��?�ͽx*����/������m�`�ux�� �px��ς�x𽏊��5|��c~|�y����{�^�j��*����{�������~��?���g�^�$�y�`�`���9�{�p��e}i��i��u߆�y�=9��������/�����/
��;��������d�r�ļ�>��|�Ƃ����ׅ����Ê�u*����$uk��~Ȁ�~��3��c�
��r���|��|��[޾����u��z�*����� �0�?������
����އ�y��_���d�����>�4���`�k�������g}r�=����ڿ�~�6e*����j��$|o� ��������{
��˻������f}������u�x�ֻ�� �r}w*����b�zҦÅ�����7���
�y�s���f��d��������ʽj��x�����hk���*�������ف���{o������z�޺�
m����@�e���k~������sf�h���*����1��ui��
o�ay'�������w�������p�'�m$��������>!���@�v�,193080d post slzrf��
�t� @0�8

�dc#?�����r��j�!�,�����c�j�b�i�ف�'y���r���f�����"xl�z+�~�z*��������rw������{؂��j��n���v���j��{캋� �vz7���������v�`*������w�)z7�q�[�փ��n�2��t�����9���~��l}��ἣ��� ~z��}��p��*����b�3���vyՁ(���;k���-�a�e�"һ��|���9˿v���t���r�߼q�c*��������{ ��1�i�"���=�0� ��{��>؀u�ƀ��nŀ��!��{;�;���d*���������x�9��
�̓�a|�p���l�6t€�h�i1*�����x4�`���yv������{�����8|��e���m�_�y�wz1�5����{��z�[�({��������^�){��
����x����g��\~1�߁��焹�>�=��Ͼ�zy��-�&��*����8r���b������yЀ�����{ԁπ�w��:�2�������d����v��{*����[� |��̀؁�|�j�{�`��~���~���������!�2�>
l���+�����bx*����*�2�
�3�ց���

writting data python3
data.write(str(x)+","+str(y)+"\n")

thanks!

can post full code of program, or link please?


raspberrypi



Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'