Search code examples
pythonandroidkivybuildozer

How would one go about making a directory (mkdir) in python with kivy on android(buildozer)?


So im trying to simply just trying to make a directory with kivy and i simply cant get it to work. I a useing the os.mkdir() function.

I have tried to just simply os.mkdir("a"), but i couldnt find any directory named a (after doing a full phone search, with the phone plugged in to my pc). I have alos tried os.getcwd() as in os.mkdir(os.getcwd()+"a"), but to no avail.

To put it simply i am lost, can't find anything about it online either... So if you know how i would greatly appreciate to be enlightend on the subject, thx in advance.

And i am importing os, also tried to run os.mkdir before importing kivy.


Solution

  • I have tried to just simply io.mkdir("a")

    There is no io.mkdir - do you mean os.mkdir?

    The directory will be created inside the current directory of the script, which is a folder inside the app's private directory as defined by Android.

    That means you should see your new directory in e.g. os.listdir(".").