0
Does the os module come standard on qpython3 for android?
7 Réponses
+ 3
Yes. Almost standard modules comes with QPython ^^
+ 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
+ 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 )
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')
0
does it have anything to do with root access and if so how do i do that?
0
so how would that look as far as code?
would i use os.setcurrentdir()?
0
ok cool ill do more research and try that out. thanks