Posts

Showing posts from July, 2022

Python script: Using PyFiglet to create a banner

Image
 This was made in Visual Studio Code within a virtual environment. The most important commands in working with your virtual environment are: 1. Create your virtual environment > py -m venv env 2. Activate your virtual environment > env\Scripts\activate 3. Go to View > select Command Palette > Select Python Interpreter > (env:venv) 3. Run your application > py main.py ------------------------------------------------------------------------------------- Screenshot  Script Desktop only: To view the script below clearly, you may right click > open image in new tab> in the new tab, your cursor will turn into a crosshair symbol > left click > will zoom in on script.

Python script - ASCII converter program using custom modules | termcolor to add colour

Image
This was made in Visual Studio Code within a virtual environment. The most important commands in working with your virtual environment are: 1. Create your virtual environment > py -m venv env 2. Activate your virtual environment > env\Scripts\activate 3. Go to View > select Command Palette > Select Python Interpreter > (env:venv) 3. Run your application > py main.py ------------------------------------------------------------------------------------- Screenshot I Screenshot II ------------------------------------------------------------------------------------- main.py Clear.py Banner.py Functions.py

C++ script - Using map and vector to map and store key-value pairs created by user input.

Image
IDE: Visual Studio OUTPUT I OUTPUT II SCRIPT To view the script below clearly, you may right click > open image in new tab> in the new tab, your cursor will turn into a crosshair symbol > left click > will zoom in on script.

Python script : Swap two numbers.

Image
The following scripts takes user input (2 numbers) and swaps the numbers. 1. You will learn to use try/except in case the user input is invalid. 2. Termcolor is a library module used to add colour to the output. Resource: https://pypi.org/project/termcolor/ Screenshot 1 Screenshot 2 This was made in Visual Studio Code within a virtual environment. The most important commands in working with your virtual environment are: 1. Create your virtual environment: > py -m venv env 2. Activate your virtual environment: > env\Scripts\activate 3. Go to View > select Command Palette > Select Python Interpreter > (env:venv) 3. Run your application: > py main.py Python script to swap two numbers: To view the script more clearly, CTRL + (scroll up using your mouse). This will zoom in on the script.

C++ script: map function | header file | implementation file | constructor | destructor | iterate through map

Image
This is a screenshot of what the output is: main.cpp Books.h Books.cpp

Python GUI Calculator : Turn script into Python executable

Image
 This was less than two hundred lines of code, however because the script is broken up into pieces, to explain everything: 1. Pay attention to indentation. 2. Pay attention to the libraries you import, as these can be easily missed. End Result: To turn this script into a python executable: - You will have to use the command pip install pyinstaller in the terminal   within your virtual environment.  - Then run either one of the commands below. Script for the GUI calculator can be obtained from: https://realpython.com/python-pyqt-gui-calculator/

Python and PyQt5: Create a window with labels, input fields and a coloured background

Image
This was made in Visual Studio Code within a virtual environment. The most important commands in working with your virtual environment are: 1. Create your virtual environment > py -m venv env 2. Activate your virtual environment > env\Scripts\activate 3. Go to View > select Command Palette > Select Python Interpreter > (env:venv) 3. Run your application > py main.py Output Code