0

Does the os module come standard on qpython3 for android?

2nd Feb 2017, 5:41 AM
Glenn Bennett
Glenn Bennett - avatar
7 Réponses
+ 3
Yes. Almost standard modules comes with QPython ^^
2nd Feb 2017, 6:04 AM
visph
visph - avatar
+ 2
Don't remember... but searching google for python curr dir; found: << os.chdir(path) Change current working directory to path. Availability: Unix, Windows. >> ... I guess this work on android who's unix-like, else search further :P
2nd Feb 2017, 6:29 AM
visph
visph - avatar
+ 1
You didn't set the current dir, so first, the place to create your new file/directory is underteminated ^^ Well, you're probably in a sub-directory of QPython app, or of your script, but maybe not... Try to choose an absolute path, to be independent from the emplacement of script/app, and be sure to choice a directory with write access ( on android this may require some authorizations, even impossibility to access external sd card, but you have at least the directory of app authorized )
2nd Feb 2017, 6:21 AM
visph
visph - avatar
0
thanks i am working on a crawler program and i was trying to use the os.functions to create files to store the crawled urls and i get an oserror saying" oserror: [ errno 30] read only file system. this is the code i wrote: import os # each website you crawl is a different project(file) def create_project_dir(directory): if not os.path.exists(directory): print("Creating project" + directory) os.makedirs(directory) create_project_dir('thenewboston')
2nd Feb 2017, 6:11 AM
Glenn Bennett
Glenn Bennett - avatar
0
does it have anything to do with root access and if so how do i do that?
2nd Feb 2017, 6:12 AM
Glenn Bennett
Glenn Bennett - avatar
0
so how would that look as far as code? would i use os.setcurrentdir()?
2nd Feb 2017, 6:25 AM
Glenn Bennett
Glenn Bennett - avatar
0
ok cool ill do more research and try that out. thanks
2nd Feb 2017, 6:31 AM
Glenn Bennett
Glenn Bennett - avatar