This project is a test project for better code structure and object orientated programming.
It may have some bugs in the middle of developing, but it could eventually become a complete and bugless project, which means this could be a really simple project.
Also, this project is for designing the RPG game as well. So you may see some codes are about games.
The structure of this project follows this.
===========================
Update:
The uploaded venv is removed and the new python environment is based on conda environment. The reason why I don't use virtual environment is the kivy doesn't support well on pip install kivy
on Ubuntu OS. The recommanded way to do that is to use conda environment as follows:
conda install kivy -c conda-forge
Although kivy could be installed successfully in conda env, jupyter notebook still could not import the module directly. It seems the kivy is actually using both python and gcc.
===========================
- Commit message should be in format of "noun" + "verb past tense", all in lower-case unless specific words needed, ie., "README updated".
Quote from here
The init.py files are required to make Python treat the directories as containing packages; this is done to prevent directories with a common name, such as string, from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, init.py can just be an empty file, but it can also execute initialization code for the package or set the all variable, described later.
Therefore, we can use an empty file as the init.py at each sub-directory.
For this project, tkinter is not in use anymore.
The tkinter is simple to use, but not quite ideal since it seems not maintained any more.
The current code is based on Kivy that is installed inside virtual environment.
The virtual environment is useful when you are trying to install all the complex packages. When someone else wants to run your code and with the virtual environment, they do not need to install the packages all over again.
To setup a virtual environment: (in this case, we are using python3.x)
-
Open terminal,
python3 -m venv /path/py_starter/virtual_env_name/
, and the "path" is the absolute path to your project directory. -
Wait for few seconds till done, then cd to your virtual environment sub directory.
-
Use
source bin/activate
, then you can install package in this environment. -
Also, after use, you can simply
deactivate
it.
To install packages in this environment:
-
Make sure you have sourced it.
-
Double check your pip version
pip --version
, and python versionpython --version
. Make sure you are using the one you want to use. -
Use
pip install example_package
, remember do not addsudo
which would install package globally. -
After step 3, you should check the package with
pip list
. If the "example_package" shows up, congratulation! You made it!
More details could be found here.
- setup the PyCharm interpreter correctly
- setup virtual environment
- import label and text widget in GUI
- make table of content for README at the beginning