Professional Documents
Culture Documents
2. Download, copy and extract the package crud-app-demo.zip. Open a terminal and go inside
crud-app-demo directory. The package should contain the following.
WSL
Command Prompt
Command Prompt
4. Activate Virtual Environment
WSL
source myenv/bin/activate
Command Prompt
.\myenv\Scripts\activate
- Notice the (myenv) prefix in the command prompt to show that the virtual environment
is already activated
- ‘where’ or ‘which’ command will also show the path of the current python interpreter
5. Install Dependencies
- In most Python projects, the dependencies are usually specified in a file called
‘requirements.txt’
pip install -r requirements.txt
6. Run the python application
- in this package, the name of the application is app_basic.py
- there is also another app containing the demo of customtkinter library
python ./app_basic.py
- you can try the buttons the create(button), read (highlight an entry), update(button) and
delete(button) employee
python ./moderngui.py
7. Most applications also contain some tests. Run the tests of the python application using
pytest.
- In this example, there is test for the database interface named test_db_if.py
pytest test_db_if.py
- running the test will populate the database. The database file is Employees.db
- If you re-run the application, you will observe that some entries are already available
- Note that some column entries does not match because the intent of the test is for the
database interface.