Re: [BangPypers] writing file with random extension to sd card using python

2017-10-27 Thread Ajinkya Bobade
Thank you for inputs really appreciate it. I was able to get an understanding of whats going on here in code. Moving forward, I have a more detailed question. In the following code, I want to capture print('Recording GPS Position...') on sd card, for now, this is printing on terminal directly I

Re: [BangPypers] writing file with random extension to sd card using python

2017-10-26 Thread Krishnan Nagarajan
Hi, Refer : https://stackoverflow.com/questions/27238680/writing-integers-in-binary-to-file-in-python With Python 3 you can do the following: i = 6277101735386680763835789423176059013767194773182842284081with open('out.bin', 'wb') as file: file.write((i).to_bytes(24, byteorder='big',

Re: [BangPypers] writing file with random extension to sd card using python

2017-10-26 Thread Sushrut Deshpande
I think you shud open file as binary write and try to write the integer after converting it to utf-8 Best Regards, Sushrut Deshpande Founder - Qvestron Systems Pvt. Ltd., dsush...@qvestron.com +91 951160 On 27 Oct 2017 00:20, at 00:20, Ajinkya Bobade wrote:

Re: [BangPypers] writing file with random extension to sd card using python

2017-10-26 Thread Sayantan
Hi Ajinkya, This is my two bits of understanding with files. The function .write( object) takes a string type of object. In this case, trying to push in a variable of type integer would obviously throw an error. With regards to your mail, we have to take into consideration that the

[BangPypers] writing file with random extension to sd card using python

2017-10-26 Thread Ajinkya Bobade
Hello, This is my first question on this forum point me in a right way if I posted in a wrong place. That aside I am trying to write a file with '.bag ' extension to sd card( .bag is used in Ross programming). I wrote a code to write a simple integer to disk as shown file =