HELP how can i open and read from files on android | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

HELP how can i open and read from files on android

18th May 2022, 10:59 AM
MULUKEN ADDIS
MULUKEN ADDIS - avatar
9 Answers
+ 3
Thanks Lothar and prince kumar
18th May 2022, 6:27 PM
MULUKEN ADDIS
MULUKEN ADDIS - avatar
+ 2
Do you mean using sololearn playground? Sololearn playground has no access to your local storage.
18th May 2022, 11:16 AM
Lisa
Lisa - avatar
+ 2
with open("/usr/local/lib/python3.8/importlib/_bootstrap_external.py") as file: print(file.read())
18th May 2022, 1:49 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 2
Muluken Addis Tamene , 2 things to consider: - the file with the python code has to be stored physically on the system - file path in android has to start with slash "/storage/emulated/....."
18th May 2022, 2:13 PM
Lothar
Lothar - avatar
+ 1
I know, i use pydroid 3 but i get bug , file not found error
18th May 2022, 11:18 AM
MULUKEN ADDIS
MULUKEN ADDIS - avatar
+ 1
Check the path again?
18th May 2022, 11:20 AM
Lisa
Lisa - avatar
+ 1
("storage/emulated/0/Boom Player/cache /discover.txt", "w+") i try this is there a syntax error?
18th May 2022, 11:22 AM
MULUKEN ADDIS
MULUKEN ADDIS - avatar
+ 1
w means write, not read
18th May 2022, 11:23 AM
Lisa
Lisa - avatar
+ 1
That is w+ not w
18th May 2022, 11:23 AM
MULUKEN ADDIS
MULUKEN ADDIS - avatar