1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Rep Power

    NXT Python - work with txt files

    I need help with reading and writing a text file in Lego NXT brick using NXT Python. Author of NXT Python says, thet I should use open_read and open_write functions in nxt/system.py, but I don't understand that.
    Thank you and sorry for my bad english
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    python statements to open a file, read the content into memory and store that object to a variable named `content' is

    with open('a.file') as inf:
    content = inf.read()

    Beyond that I don't know how to assist.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo