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

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    NXT Python - work with txt files


    Hi,
    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 Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,997
    Rep Power
    481
    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