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

Ajinkya Bobade ajinkyabobade93 at gmail.com
Thu Oct 26 14:49:51 EDT 2017


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 = open("/path/to/file", 'w')
x = 1

while True:
    x = x + 1
    print(x)
    file.write(str(x))
    file.flush()

in this code I could not write file.write(x). Why is this?If I want to
store a file(' as it is') on this disk without converting it into string
what should I do?


More information about the BangPypers mailing list