1

Is there any way to create my own module in qpython3 ? If there is, it would be great to fix my code properly, without going all the way down to fix just onde line.

3 Answers3

0

well, i'm creating a game with 3 games inside it and i would like to put the game functions inside individual modules, like: from tictactoe import structureTictactoe from Chess import structureChess

then these functions when called simply print the specific game structure like the tictactoe grade and the chess table. For instance, it's simpler to edit the game functions inside individual modules

0

You have to write the functions that you want into a .py script that has the same name as you want the module to be called. You then have to add that into the site packages directory and then you should be able to access them from anywhere. Just make sure that it is in the "qpython\lib\python3.2\packages\" directory

0

create your game library, such as myGameLib.py in your script's local directory.

Then from your main python code:

import from myGameLib *

Note that this will work. However, if you want to create a sub directory for your python lib, such as a local directory to your script, /mysubdir,

import from mysubdir.myGameLib *

appears to be broken in QPython3.