loading an arbitrary binary file

36 views
Skip to first unread message

David Liebman

unread,
Aug 9, 2015, 4:49:17 PM8/9/15
to Py4A
how do you load a binary or text file? In normal python, If I have a file named 'test.txt' with the contents 'hello world' and I execute the following code from the same directory:

f = open("test.txt","r")
print(f.readlines())
f.close()

I see text on the screen. How do I do this in py4a? I have some pickle files that I'd like access to. I can reformat them to text or some other binary format, but would this work?

David Liebman

unread,
Aug 11, 2015, 5:23:43 PM8/11/15
to Py4A
I've converted my pickle file to a text file, with entries separated by space characters. Now I have large text files. what do I do to read this kind of file? also, what folder in the python-for-android file structure do I put my text files?
Reply all
Reply to author
Forward
0 new messages