Search code examples
qpython3

How to create a module[qpython3]


Noob alert!

I'm wondering how you go about importing a module(one made in qpython)? I've tried making a new folder and adding a setup.py then trying to import but just get error about module not found(or something)..

Thanks in advance


Solution

  • Your folder must to consist in Path variable. You must append path to your folder in this variable. Add the following lines to the top of your project main file:

    import sys
    sys.path.append(yourPath)
    

    yourPath must be a string type. For example:

    '/storage/sdcard0/myfolder'